BLAKE3-team / BLAKE3

the official Rust and C implementations of the BLAKE3 cryptographic hash function
Apache License 2.0
5.07k stars 346 forks source link

blake3.c:354:22: error: logical ‘and’ of mutually exclusive tests is always false [-Werror=logical-op] #379

Closed divinity76 closed 7 months ago

divinity76 commented 8 months ago

any suggestions on fixing this?

/bin/bash /home/travis/build/php/php-src/libtool --silent --preserve-dup-deps --tag=CC --mode=compile gcc -Iext/hash/ -I/home/travis/build/php/php-src/ext/hash/ -I/home/travis/build/php/php-src/include -I/home/travis/build/php/php-src/main -I/home/travis/build/php/php-src -I/home/travis/build/php/php-src/ext/date/lib -I/usr/include/libxml2 -I/usr/include/s390x-linux-gnu -I/usr/include/enchant -I/usr/include/glib-2.0 -I/usr/lib/s390x-linux-gnu/glib-2.0/include -I/usr/include/libpng16 -I/usr/include/freetype2 -I/home/travis/build/php/php-src/ext/mbstring/libmbfl -I/home/travis/build/php/php-src/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/usr/include/tidy -I/home/travis/build/php/php-src/TSRM -I/home/travis/build/php/php-src/Zend  -D_GNU_SOURCE -D_REENTRANT -pthread  -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -fvisibility=hidden -pthread -O0 -Wimplicit-fallthrough=1 -DZTS -DZEND_SIGNALS -DZEND_MAX_EXECUTION_TIMERS -Werror    -DBLAKE3_USE_NEON=0 -c /home/travis/build/php/php-src/ext/hash/blake3/upstream_blake3/c/blake3.c -o ext/hash/blake3/upstream_blake3/c/blake3.lo  -MMD -MF ext/hash/blake3/upstream_blake3/c/blake3.dep -MT ext/hash/blake3/upstream_blake3/c/blake3.lo

/home/travis/build/php/php-src/ext/hash/blake3/upstream_blake3/c/blake3.c: In function ‘compress_subtree_to_parent_node’:

/home/travis/build/php/php-src/ext/hash/blake3/upstream_blake3/c/blake3.c:354:22: error: logical ‘and’ of mutually exclusive tests is always false [-Werror=logical-op]

  354 |   while (num_cvs > 2 && num_cvs <= MAX_SIMD_DEGREE_OR_2) {

      |                      ^~

cc1: all warnings being treated as errors

make: *** [Makefile:1910: ext/hash/blake3/upstream_blake3/c/blake3.lo] Error 1

make: *** Waiting for unfinished jobs....

observed on 1.5.0, full compiler log https://app.travis-ci.com/github/php/php-src/builds/268584939 , source https://github.com/php/php-src/pull/13194