]> git.kaiwu.me - haproxy.git/commit
BUILD: tools: memchr definition changed in C23
authorWilliam Lallemand <wlallemand@irq6.net>
Wed, 7 Jan 2026 13:41:06 +0000 (14:41 +0100)
committerWilliam Lallemand <wlallemand@irq6.net>
Wed, 7 Jan 2026 13:51:26 +0000 (14:51 +0100)
commit4aff6d1c2550807fb67da56ad15fade8ab4a6d8d
tree7fecdb880516167ac63cd2d8df8947686e3f05b9
parent5322bd3785353194afb384c18e1f92cffd52f613
BUILD: tools: memchr definition changed in C23

New gcc and clang versions from fedora rawhide seems to use the C23
standard by default. This version changes the definition of some
string.h functions, which now return a const char * instead of a char *.

src/tools.c: In function ‘fgets_from_mem’:
src/tools.c:7200:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 7200 |         new_pos = memchr(*position, '\n', size);
      |                 ^

Strangely, -Wdiscarded-qualifiers does not seem to catch all the
memchr.

Should fix issue #3228.

This could be backported in previous versions.
src/tools.c