1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-13 11:36:09 +02:00

silenc gcc Werror=logical-op

ref https://github.com/BLAKE3-team/BLAKE3/issues/379

/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
This commit is contained in:
divinity76 2024-01-29 12:01:58 +01:00 committed by GitHub
parent a65fcf63ee
commit d48f0f62bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -351,7 +351,11 @@ INLINE void compress_subtree_to_parent_node(
// is set on platforms where MAX_SIMD_DEGREE_OR_2 == 2, GCC emits spurious
// warnings here. GCC 8.5 is particularly sensitive, so if you're changing
// this code, test it against that version.
while (num_cvs > 2 && num_cvs <= MAX_SIMD_DEGREE_OR_2) {
while (num_cvs > 2
#if MAX_SIMD_DEGREE_OR_2 > 2
&& num_cvs <= MAX_SIMD_DEGREE_OR_2
#endif
) {
num_cvs =
compress_parents_parallel(cv_array, num_cvs, key, flags, out_array);
memcpy(cv_array, out_array, num_cvs * BLAKE3_OUT_LEN);