cs50 / help50-deprecated

This is help50, a command-line tool that helps students understand error messages.
https://cs50.harvard.edu/
GNU General Public License v3.0
62 stars 64 forks source link

relational comparison result unused #126

Closed brianyu28 closed 8 years ago

brianyu28 commented 8 years ago
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow    mario.c  -lcs50 -lm -o mario
mario.c:12:19: error: relational comparison result unused [-Werror,-Wunused-comparison]
    while (height < 0, height < 23);
           ~~~~~~~^~~
1 error generated.
make: *** [mario] Error 1
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow    mario.c  -lcs50 -lm -o mario
mario.c:16:26: error: relational comparison result unused [-Werror,-Wunused-comparison]
    for (h = 0; h > 0; h < 23)
                       ~~^~~~
1 error generated.
make: *** [mario] Error 1
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow    initials.c  -lcs50 -lm -o initials
initials.c:16:18: error: relational comparison result unused [-Werror,-Wunused-comparison]
        for(argc > 0; argc < 4; argc++)
            ~~~~~^~~
1 error generated.
make: *** [initials] Error 1
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wshadow    vigenere.c  -lcs50 -lm -lcrypt -o vigenere
vigenere.c:41:66: error: relational comparison result unused [-Werror,-Wunused-comparison]
    for (int i = 0, c = 0, n = strlen(key), m = strlen(plain); i < m, c < n; i++, c++)
                                                               ~~^~~
1 error generated.
make: *** [vigenere] Error 1
dmalan commented 8 years ago

https://github.com/cs50/help50/commit/9b640b41cc0d94bf32888abaa9a4fdf418b62e2b

dmalan commented 8 years ago

@brianyu28 I added back has_caret for this kind of scenario since calling caret_extract but not using the result didn't feel quite right, especially since the symbol here is <.