Skip to content

Suppress warnings in ARM environments #14

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

onihusube
Copy link

The following warning occurs when using this library in an ARM environment(Raspberry Pi GCC 10.2).

../subprojects/ProgramOptions.hxx/include/ProgramOptions.hxx: In function ‘bool po::case_insensitive_eq(char, char)’:
../subprojects/ProgramOptions.hxx/include/ProgramOptions.hxx:257:8: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  257 |   if(x >= 0 && y >= 0)
      |      ~~^~~~
../subprojects/ProgramOptions.hxx/include/ProgramOptions.hxx:257:18: warning: comparison is always true due to limited range of data type [-Wtype-limits]
  257 |   if(x >= 0 && y >= 0)
      |                ~~^~~~

The reason for this is that char is unsigned in GCC in the ARM environment.

I checked and found that the __CHAR_UNSIGNED__ macro is provided in this case, so I used it to disable the code that checks if the char value is positive.

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 this pull request may close these issues.

1 participant