Skip to content

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Nov 17, 2024

…ning)

gcc-15 switched to -std=c23 by default:

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

As a result lsof fails the build as:

 misc.c:390:26: error: too many arguments to function 'r_fn'
   390 |                     rv = r_fn(r_arg, r.r_rbuf, r_rbln);
       |                          ^~~~

Before C23 int (*)() meant any function that returns int. In C23 if means only int (*)(void). But lsof alwaus uses int (*)(char *path, char *buf, int len) in that place. Switched to explicit function type instead.

…ning)

gcc-15 switched to -std=c23 by default:

    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

As a result `lsof` fails the build as:

     misc.c:390:26: error: too many arguments to function 'r_fn'
       390 |                     rv = r_fn(r_arg, r.r_rbuf, r_rbln);
           |                          ^~~~

Before C23 `int (*)()` meant any function that returns `int`. In `C23`
if means only `int (*)(void)`. But `lsof` alwaus uses
`int (*)(char *path, char *buf, int len)` in that place. Switched to
explicit function type instead.
@jiegec jiegec merged commit b272609 into lsof-org:master Nov 18, 2024
4 of 5 checks passed
@trofi trofi deleted the gcc-15-c23 branch November 18, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants