]> git.ipfire.org Git - thirdparty/elfutils.git/commit
elfclassify: Use (void) for no-argument static functions, not ()
authorMark Wielaard <mark@klomp.org>
Sat, 30 Aug 2025 13:47:24 +0000 (15:47 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 30 Aug 2025 14:02:58 +0000 (16:02 +0200)
commit321b759af24d3630773c7a3725de3296d60f54f4
tree52fe855eb7a97d0b05b2a7c3a543164b2ae7e68f
parent1c23d5929a2f52986b2452fe0e9d34b12b39b313
elfclassify: Use (void) for no-argument static functions, not ()

In -std=gnu11 mode gcc will error out on nor argument () static
functions:

src/elfclassify.c:757:1: error: function declaration isn’t a prototype
 [-Werror=strict-prototypes]
  757 | check_checks ()
      | ^~~~~~~~~~~~
src/elfclassify.c: In function ‘check_checks’:
src/elfclassify.c:757:1: error: old-style function definition
 [-Werror=old-style-definition]

This isn't an issue in -std=gnu23 mode (the default with GCC 15):

  A definition using () is not considered an old-style definition in
  C23 mode, because it is equivalent to (void) in that case, but is
  considered an old-style definition for older standards

So just always use (void) instead of () for an empty argument list.

* src/elfclassify.c (check_checks): Define as check_checks (void).
(check_ar_members): Define as check_ar_members (void).

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/elfclassify.c