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

-Wsign-compare in image-pam.cpp #564

Open
ziemek99 opened this issue Dec 14, 2021 · 0 comments
Open

-Wsign-compare in image-pam.cpp #564

ziemek99 opened this issue Dec 14, 2021 · 0 comments

Comments

@ziemek99
Copy link
Member

ziemek99 commented Dec 14, 2021

image/image-pam.cpp:90:27: warning: comparison of integer expressions of different signedness: ‘ColorVal’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]
   90 |                 if (pixel > maxval)
      |                     ~~~~~~^~~~~~~~
image/image-pam.cpp:106:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  106 |                 if (pixel > maxval)
      |                     ~~~~~~^~~~~~~~

Introduced in #532. The first warning is especially problematic because the definition of ColorVal can change depending on build options:

FLIF/src/image/image.hpp

Lines 36 to 40 in 0074d6f

#ifdef SUPPORT_HDR
typedef int32_t ColorVal; // used in computations
#else
typedef int16_t ColorVal; // at most 9-bit numbers + sign
#endif

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

1 participant