Skip to content

Commit

Permalink
silenc gcc Werror=logical-op
Browse files Browse the repository at this point in the history
ref BLAKE3-team#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
  • Loading branch information
divinity76 authored Jan 29, 2024
1 parent a65fcf6 commit d48f0f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion c/blake3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d48f0f6

Please sign in to comment.