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

Comparison of unsigned expression < 0 is always false #12

Open
ryandesign opened this issue Oct 2, 2019 · 0 comments
Open

Comparison of unsigned expression < 0 is always false #12

ryandesign opened this issue Oct 2, 2019 · 0 comments

Comments

@ryandesign
Copy link
Contributor

When compiling the latest master, clang points out that some of your comparisons are tautological:

vxlan.c:108:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if (len < 0)
            ~~~ ^ ~
vde_autolink.c:865:41: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if( (curlink->portno = port_reserve()) < 0 ){
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
wirefilter.c:214:12: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (next < 0) next=0;
                    ~~~~ ^ ~
wirefilter.c:1638:35: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                (markovdelay < delay || delay < 0)) delay=markovdelay;
                                                        ~~~~~ ^ ~
wirefilter.c:1649:38: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                        if (speeddelay < delay || delay < 0) delay=speeddelay;
                                                                  ~~~~~ ^ ~
wirefilter.c:1664:39: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                                if (speeddelay < delay || delay < 0) delay=speeddelay;
                                                                          ~~~~~ ^ ~
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

No branches or pull requests

1 participant