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

[GCC15/C23] pdf.c:79:32: error: passing argument 2 of ‘start_process’ from incompatible pointer type #605

Open
immolo opened this issue Nov 20, 2024 · 0 comments

Comments

@immolo
Copy link

immolo commented Nov 20, 2024

Describe the bug
Upcoming GCC 15 defaults to -std=gnu23. cups-filters=2.01 fails to build as
follows:

filter/foomatic-rip/pdf.c:79:32: error: passing argument 2 of ‘start_process’ from incompatible pointer type [-Wincompatible-pointer-types]
   79 |   kid3 = start_process("kid3", exec_kid3, (void *)cmd, NULL, NULL);
      |                                ^~~~~~~~~
      |                                |
      |                                int (*)(FILE *, FILE *, void *)
In file included from filter/foomatic-rip/pdf.c:16:
filter/foomatic-rip/process.h:21:45: note: expected ‘int (*)(void)’ but argument is of type ‘int (*)(FILE *, FILE *, void *)’
   21 | pid_t start_process(const char *name, int (*proc_func)(), void *user_arg,
      |                                       ~~~~~~^~~~~~~~~~~~
filter/foomatic-rip/renderer.c: In function ‘exec_kid3’:
filter/foomatic-rip/renderer.c:456:32: error: passing argument 2 of ‘start_process’ from incompatible pointer type [-Wincompatible-pointer-types]
  456 |   kid4 = start_process("kid4", exec_kid4, NULL, &kid4in, NULL);
      |                                ^~~~~~~~~
      |                                |
      |                                int (*)(FILE *, FILE *, void *)
In file included from filter/foomatic-rip/renderer.c:21:
filter/foomatic-rip/process.h:21:45: note: expected ‘int (*)(void)’ but argument is of type ‘int (*)(FILE *, FILE *, void *)’
   21 | pid_t start_process(const char *name, int (*proc_func)(), void *user_arg,
      |                                       ~~~~~~^~~~~~~~~~~~
make[2]: *** [Makefile:2047: filter/foomatic-rip/foomatic_rip-pdf.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:2089: filter/foomatic-rip/foomatic_rip-renderer.o] Error 1
filter/foomatic-rip/postscript.c: In function ‘get_renderer_handle’:
filter/foomatic-rip/postscript.c:1444:32: error: passing argument 2 of ‘start_process’ from incompatible pointer type [-Wincompatible-pointer-types]
 1444 |   kid3 = start_process("kid3", exec_kid3, (void *)cmdline->data, &kid3in, NULL);
      |                                ^~~~~~~~~
      |                                |
      |                                int (*)(FILE *, FILE *, void *)
In file included from filter/foomatic-rip/postscript.c:17:
filter/foomatic-rip/process.h:21:45: note: expected ‘int (*)(void)’ but argument is of type ‘int (*)(FILE *, FILE *, void *)’
   21 | pid_t start_process(const char *name, int (*proc_func)(), void *user_arg,
      |                                       ~~~~~~^~~~~~~~~~~~
make[2]: *** [Makefile:2061: filter/foomatic-rip/foomatic_rip-postscript.o] Error 1
filter/foomatic-rip/process.c:231:1: error: conflicting types for ‘start_process’; have ‘pid_t(const char *, int (*)(FILE *, FILE *, void *), void *, FILE **, FILE **)’ {aka ‘int(const char *, int (*)(FILE *, FILE *, void *), void *, FILE **, FILE **)’}
  231 | start_process(const char *name,
      | ^~~~~~~~~~~~~
In file included from filter/foomatic-rip/process.c:14:
filter/foomatic-rip/process.h:21:7: note: previous declaration of ‘start_process’ with type ‘pid_t(const char *, int (*)(void), void *, FILE **, FILE **)’ {aka ‘int(const char *, int (*)(void), void *, FILE **, FILE **)’}
   21 | pid_t start_process(const char *name, int (*proc_func)(), void *user_arg,

This is because C23 removes unprotoyped functions.

It should be possible to reproduce these with older GCC (and Clang) with
-std=gnu23 or -std=c23 set manually.

tdr-emerge-info.txt
cups-filters-2.0.1.buid.log

Gentoo bug: https://bugs.gentoo.org/944074

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Nov 24, 2024
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