Cchar != eltype(Cstring)

strings

#1

So I am wrapping some C libraries in Julia, and noticed that Cchar maps to Int8, whereas Cstring has an eltype of UInt8, calling pointer(some_cstring) returns a Ptr{UInt8}. This inconsistency seems rather odd. Furthermore, the documentation for Cstring states that “A C-style string composed of the native character type Cchars” which I would expect, but doesn’t seem to match the actual implementation.

So is this a bug with how Cstring is implemented? With how it’s documented? Maybe it’s intentionally different? (buty why?) Maybe I’m just missing something?

I know that char in C is not defined to be either signed nor unsigned but rather left to the implementation, so maybe this is related to that. I’m on Linux x64 for what it’s worth.


#2

Probably just an oversight. Would you mind filing an issue?


#3