Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

& unsupported #545

Closed
choffstein opened this issue Mar 8, 2012 · 7 comments
Closed

& unsupported #545

choffstein opened this issue Mar 8, 2012 · 7 comments

Comments

@choffstein
Copy link

Just did a git pull to merge in any recent commits. Trying to do some ccalls where I need to pass a pointer to a scalar, but I can't even get it working repl.

julia> x = 0
0

julia> &x
not supported

Mac OS X 10.7.3.

@JeffBezanson
Copy link
Sponsor Member

&x is special syntax that is part of ccall.

@choffstein
Copy link
Author

Hmm. Maybe I need to rebuild from source @JeffBezanson?

julia> s = "this is a test"
"this is a test"

julia> so = Array(Ptr{Uint8},1)
[Ptr{Uint8} @0x0000000000000000]

julia> sz = 0
0

julia> ccall(dlsym(_jl_zlib_wrapper, :_jl_zlib_deflate), Uint8, (Ptr{Uint8}, Ptr{Uint}, Ptr{Ptr{Uint8}}), cstring(s)[1], &sz, so)
unsupported expression type &

@JeffBezanson
Copy link
Sponsor Member

Oh, ok. That makes much more sense. Did you rebuild after pulling?

@choffstein
Copy link
Author

Yep. Sorry -- even though I did the git pull, I forgot to make!

@dronir
Copy link
Contributor

dronir commented Mar 12, 2012

I'm getting this same thing with a version I pulled just last night.

julia> ccall(dlsym(libnetcdf, :nc_create), 
             Int32, 
             (Ptr{Uint8}, Int32, Ptr{Int32}), 
             (cstring(filename), NC_NOCLOBBER, &ID)))
unsupported expression type &

@JeffBezanson
Copy link
Sponsor Member

You have an extra set of parentheses around the arguments. Should be:

julia> ccall(dlsym(libnetcdf, :nc_create), 
             Int32, 
             (Ptr{Uint8}, Int32, Ptr{Int32}), 
             cstring(filename), NC_NOCLOBBER, &ID)

@dronir
Copy link
Contributor

dronir commented Mar 12, 2012

Ah, thanks, that cleared it. Shouldn't maybe have written that at 3am…

LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Oct 11, 2021
Keno pushed a commit that referenced this issue Oct 9, 2023
It would be better to use a consistent style in our code base.
This is also aligned with the convention we're using for Julia base.
ViralBShah pushed a commit that referenced this issue Jun 25, 2024
Stdlib: SparseArrays
URL: https://github.com/JuliaSparse/SparseArrays.jl.git
Stdlib branch: main
Julia branch: master
Old commit: 82b385f
New commit: e61663a
Julia version: 1.12.0-DEV
SparseArrays version: 1.12.0
Bump invoked by: @ViralBShah
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaSparse/SparseArrays.jl@82b385f...e61663a

```
$ git log --oneline 82b385f..e61663a
e61663a Update to SuiteSparse 7.7 (#545)
4141e8a Update gen/README.md (#544)
45dfe45 Update ci.yml to ot fail if codecov fails (#541)
0888db6 Bump julia-actions/cache from 1 to 2 (#540)
740b82a test: Don't use GPL module when Base.USE_GPL_LIBS=false (#535)
```

Co-authored-by: Dilum Aluthge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants