]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsfd: fix bsearch macro usage with glibc C23
authorCristian Rodríguez <cristian@rodriguez.im>
Sat, 22 Nov 2025 13:41:08 +0000 (10:41 -0300)
committerCristian Rodríguez <cristian@rodriguez.im>
Sun, 23 Nov 2025 13:04:50 +0000 (10:04 -0300)
commit711bda1441561bfd2eb6d45fe0bc789535c1f1a8
treedd0e0c606dcf998bec4b03227933ee903f87fc9f
parent21bf9f6d442e42dc62ca7905770f2429a7eb0cb9
lsfd: fix bsearch macro usage with glibc C23

C23 requires bsearch to be a const preserving macro, build now fails
with

../lsfd-cmd/lsfd.c:1879:75: error: macro ‘bsearch’ passed 6 arguments, but takes just 5
 1879 |                                     nfds, sizeof(struct pollfd), pollfdcmp))
      |                                                                           ^
In file included from ../include/c.h:17,
                 from ../lsfd-cmd/lsfd.c:48:
/usr/include/stdlib.h:987:10: note: macro ‘bsearch’ defined here
  987 | # define bsearch(KEY, BASE, NMEMB, SIZE, COMPAR)                        \

  add parenthesis around expression to fix it.
lsfd-cmd/lsfd.c