Skip to content

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