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

Fails to compile on architectures where char is unsigned by default #53

Closed
tadpol opened this issue Aug 10, 2022 · 3 comments · Fixed by #54
Closed

Fails to compile on architectures where char is unsigned by default #53

tadpol opened this issue Aug 10, 2022 · 3 comments · Fixed by #54

Comments

@tadpol
Copy link
Contributor

tadpol commented Aug 10, 2022

Similar issue (maybe the same issue?) was fixed in the Datastax/cpp-driver here: datastax/cpp-driver#320

#19 128.4 /opt/app/deps/erlcass/c_src/uuid_serialization.cc:44:1: error: narrowing conversion of '-1' from 'int' to 'char' [-Wnarrowing]
#19 128.4 /opt/app/deps/erlcass/c_src/uuid_serialization.cc: In function 'CassError erlcass::cass_uuid_from_string_n(const char*, size_t, CassUuid*)':
#19 128.4 /opt/app/deps/erlcass/c_src/uuid_serialization.cc:81:60: error: comparison is always false due to limited range of data type [-Werror=type-limits]
#19 128.4    81 |         if (kHexaToByteTable[static_cast<uint8_t>(pos[0])] == -1 || kHexaToByteTable[static_cast<uint8_t>(pos[1])] == -1)
#19 128.4       |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
#19 128.4 /opt/app/deps/erlcass/c_src/uuid_serialization.cc:81:116: error: comparison is always false due to limited range of data type [-Werror=type-limits]
#19 128.4    81 |         if (kHexaToByteTable[static_cast<uint8_t>(pos[0])] == -1 || kHexaToByteTable[static_cast<uint8_t>(pos[1])] == -1)
#19 128.4       |                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
#19 128.4  CPP    fun_bindings.cc
#19 128.5 cc1plus: all warnings being treated as errors
#19 128.5 make[1]: *** [nif.mk:84: /opt/app/deps/erlcass/c_src/uuid_serialization.o] Error 1
#19 128.5 make[1]: *** Waiting for unfinished jobs....
#19 130.3 make[1]: Leaving directory '/opt/app/deps/erlcass/c_src'
#19 130.3 make: *** [Makefile:44: nif_compile] Error 2
#19 130.3 ===> Hook for compile failed!
@silviucpp
Copy link
Owner

Can you please send a pull request ?

@louiscb
Copy link

louiscb commented Aug 16, 2022

Have encountered this issue on my arm64 m1 Mac, so fixing this would be great

@tadpol
Copy link
Contributor Author

tadpol commented Aug 16, 2022

Exactly where I'm hitting it as well.

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

Successfully merging a pull request may close this issue.

3 participants