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

test-gtx_fast_trigonometry fails on raspberry pi 3, while compiling with clang #839

Closed
kaomoneus opened this issue Nov 26, 2018 · 3 comments
Assignees
Milestone

Comments

@kaomoneus
Copy link

kaomoneus commented Nov 26, 2018

clang version 3.8.1-24+rpi (tags/RELEASE_381/final)
Affects glm-0.9.9.3

/home/pi/sync-dest/libglm/glm-0.9.9.3/test/gtx/gtx_component_wise.cpp:81:17: error: comparison of constant -128 with
      expression of type 'const char' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
                        Error += A.y == -128 ? 0 : 1;
                                 ~~~ ^  ~~~~
1 error generated.

Looks like a clang bug (char variable may take a -128 value). And yet better to leave it here.

@epajarre
Copy link

I think that C++ "plain" char might be either signed or unsigned, and some docs seem to indicate that on ARM it is unsigned typically.

And at least if GLM_AS_EXTENDED_INTEGER_TYPE is not defined, int8 is typedefed to plain char.

Maybe it should be changed to signed char?

(my glm version might not be the latest, apologies if this is an old version)

@kaomoneus
Copy link
Author

Wow! Frankly I'm surprised about unsigned char.
In this case we should take into account CHAR_MIN and CHAR_MAX constants (defined in limits).

@Groovounet
Copy link
Member

This issue should be fixed in master branch for GLM 0.9.9.4 release.

Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants