Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issues with GCC-15: many incompatible-pointer-types errors #322

Open
NHOrus opened this issue Feb 15, 2025 · 0 comments
Open

Build issues with GCC-15: many incompatible-pointer-types errors #322

NHOrus opened this issue Feb 15, 2025 · 0 comments

Comments

@NHOrus
Copy link

NHOrus commented Feb 15, 2025

GCC 15 will default to -std=gnu23. C23 removes unprotoyped functions, so x() now means x(void)

On Gentoo:

x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -ggdb -I. -Wall -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -Wno-stringop-truncation -Wmissing-prototypes -Wmissing-declarations -Wformat-security    -c -o atopsar.o atopsar.c
showprocs.c: In function ‘showprocline’:
showprocs.c:500:38: error: too many arguments to function ‘curelem.pf->doactiveconvert’; expected 0, have 3
  500 |                         printg("%s", curelem.pf->doactiveconvert(curstat,
      |                                      ^~~~~~~                     ~~~~~~~
In file included from showprocs.c:61:
showlinux.h:105:17: note: declared here
  105 |         char *(*doactiveconvert)();      // pointer to conv function
      |                 ^~~~~~~~~~~~~~~
showprocs.c:505:38: error: too many arguments to function ‘curelem.pf->doexitconvert’; expected 0, have 3
  505 |                         printg("%s", curelem.pf->doexitconvert(curstat,
      |                                      ^~~~~~~                   ~~~~~~~
showlinux.h:107:17: note: declared here
  107 |         char *(*doexitconvert)();        // pointer to conv function
      |                 ^~~~~~~~~~~~~
showprocs.c: At top level:
showprocs.c:582:20: error: initialization of ‘char * (*)(void)’ from incompatible pointer type ‘char * (*)(struct tstat *, int,  int)’ [-Wincompatible-pointer-types]
  582 |    { "TID", "TID", procprt_TID_ae, procprt_TID_ae, ' ', 5}; //DYNAMIC WIDTH!
      |                    ^~~~~~~~~~~~~~
showprocs.c:582:20: note: (near initialization for ‘procprt_TID.doactiveconvert’)
showprocs.c:570:1: note: ‘procprt_TID_ae’ declared here
  570 | procprt_TID_ae(struct tstat *curstat, int avgval, int nsecs)
      | ^~~~~~~~~~~~~~
showprocs.c:582:36: error: initialization of ‘char * (*)(void)’ from incompatible pointer type ‘char * (*)(struct tstat *, int,  int)’ [-Wincompatible-pointer-types]
  582 |    { "TID", "TID", procprt_TID_ae, procprt_TID_ae, ' ', 5}; //DYNAMIC WIDTH!
      |                                    ^~~~~~~~~~~~~~
showprocs.c:582:36: note: (near initialization for ‘procprt_TID.doexitconvert’)
showprocs.c:570:1: note: ‘procprt_TID_ae’ declared here
  570 | procprt_TID_ae(struct tstat *curstat, int avgval, int nsecs)
      | ^~~~~~~~~~~~~~
showprocs.c:606:20: error: initialization of ‘char * (*)(void)’ from incompatible pointer type ‘char * (*)(struct tstat *, int,  int)’ [-Wincompatible-pointer-types]
  606 |    { "PID", "PID", procprt_PID_a, procprt_PID_e, ' ', 5}; //DYNAMIC WIDTH!
      |                    ^~~~~~~~~~~~~
showprocs.c:606:20: note: (near initialization for ‘procprt_PID.doactiveconvert’)
showprocs.c:585:1: note: ‘procprt_PID_a’ declared here
  585 | procprt_PID_a(struct tstat *curstat, int avgval, int nsecs)

see https://bugs.gentoo.org/945250

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

No branches or pull requests

1 participant