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

Drop >= LFS_ZERO (always true, generates warning) #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AE1020
Copy link

@AE1020 AE1020 commented Aug 22, 2020

On the line that says:

 if(strategy >= LFS_ZERO && strategy <= LFS_FOUR) {

If compiler warnings are turned up, they will give:

lodepng.cpp: In function ‘filter’:
lodepng.cpp:5437:3: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]

It's not a terribly useful warning here. But it is in some cases informative and can catch misunderstandings, so nice to not have to disable it in a build that treats warnings as errors.

On the line that says:

     if(strategy >= LFS_ZERO && strategy <= LFS_FOUR) {

If compiler warnings are turned up, they will give:

    lodepng.cpp: In function ‘filter’:
    lodepng.cpp:5437:3: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]

It's not a terribly useful warning here.  But it is in some cases informative and can catch misunderstandings, so nice to not have to disable it in a build that treats warnings as errors.
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.

None yet

1 participant