haproxy/include/import
Willy Tarreau 8df44eea6d BUILD: cebtree: silence a bogus gcc warning on impossible code paths
gcc-12 and above report a wrong warning about a negative length being
passed to memcmp() on an impossible code path when built at -O0. The
pattern is the same at a few places, basically:

  int foo(int op, const void *a, const void *b, size_t size, size_t arg)
  {
      if (op == 1) // arg is a strict multiple of size
          return memcmp(a, b, arg - size);
      return 0;
  }
  ...
  int bar()
  {
     return foo(0, a, b, sizeof(something), 0);
  }

It *might* be possible to invent dummy values for the "len" argument
above in the real code, but that significantly complexifies it and as
usual can easily result in introducing undesired bugs.

Here we take a different approach consisting in shutting the
-Wstringop-overread warning on gcc>=12 at -O0 since that's the only
condition that triggers it. The issue was reported to and confirmed by
the gcc team here:  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114622

No backport needed, but this should be upstreamed into cebtree after
checking that all involved macros are available.
2024-09-18 17:42:52 +02:00
..
atomic-ops.h
cebtree-prv.h BUILD: cebtree: silence a bogus gcc warning on impossible code paths 2024-09-18 17:42:52 +02:00
cebtree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebu32_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebu64_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebua_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebub_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebuib_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebuis_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebul_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebus_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
eb32sctree.h
eb32tree.h
eb64tree.h
ebimtree.h
ebistree.h CLEANUP: assorted typo fixes in the code and comments 2024-09-03 17:49:21 +02:00
ebmbtree.h
ebpttree.h
ebsttree.h CLEANUP: assorted typo fixes in the code and comments 2024-09-03 17:49:21 +02:00
ebtree-t.h
ebtree.h
ist.h MINOR: ist: define iststrip() new function 2024-04-26 11:29:25 +02:00
lru.h
mjson.h
mt_list.h CLEANUP: assorted typo fixes in the code and comments 2024-09-03 17:49:21 +02:00
plock.h
sha1.h
slz-tables.h BUILD: tree-wide: fix a few missing includes in a few files 2024-03-05 11:50:34 +01:00
slz.h
xxhash.h BUILD: xxhash: silence a build warning on Solaris + gcc-5.5 2024-04-17 09:43:32 +02:00