Skip to content

Different string type on aarch64-linux and everything else? #247

Answered by keynmol
kubukoz asked this question in Q&A
Discussion options

You must be logged in to vote

I've seen this before.

Bindgen by itself does not have platform specific code, it uses libclang for introspection of numeric types.

Seems like on all platforms I test on apart from arm64 linux, the implementation of what "char" means is a signed char.

The standard though doesn't specify what char means (words on SO, I didn't bother to verify: https://stackoverflow.com/a/2054941).

To enforce one way or another, you can use -fsigned-char or -funsigned-char in clang flags passed to bindgen.

I recommend using -fsigned-char as it will use CString in the bindings.

Confirmed in an arm64 VM:

$ bin/bindgen --header test.h --package sqlite --scala --clang -fsigned-char
package sqlite

import _root_.s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by keynmol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants