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

Fix build failures with standard C 2023. #18

Merged
merged 1 commit into from
Feb 25, 2025
Merged

Conversation

emollier
Copy link
Contributor

As initially identified in Debian bug #1097250, PGPLOT is affected by build failures caused by mismatching prototypes with Gcc 15:

In file included from PGPLOT.xs:16:
pgfun.c: In function ‘pgfun1’:
pgfun.c:78:7: warning: old-style function definition [-Wold-style-definition]
   78 | float pgfun1(x)
      |       ^~~~~~
pgfun.c:79:4: error: number of arguments doesn’t match prototype
   79 |    float *x; {
      |    ^~~~~
pgfun.c:29:7: error: prototype declaration
   29 | float pgfun1();
      |       ^~~~~~
pgfun.c: In function ‘pgfun2’:
pgfun.c:120:7: warning: old-style function definition [-Wold-style-definition]
  120 | float pgfun2(x)
      |       ^~~~~~
pgfun.c:121:4: error: number of arguments doesn’t match prototype
  121 |    float *x; {
      |    ^~~~~
pgfun.c:30:7: error: prototype declaration
   30 | float pgfun2();
      |       ^~~~~~
pgfun.c: In function ‘pgfunplot’:
pgfun.c:161:6: warning: old-style function definition [-Wold-style-definition]
  161 | void pgfunplot(visible,x,y,z)
      |      ^~~~~~~~~
pgfun.c:163:4: error: number of arguments doesn’t match prototype
  163 |    float *x,*y,*z; {
      |    ^~~~~
pgfun.c:31:8: error: prototype declaration
   31 | void   pgfunplot();
      |        ^~~~~~~~~

This patch adds missing function argument types in prototypes, and casts a couple of indirect function calls, to ensure compatibility with the standard C 2023, now selected by default by gcc 15 and later.

As initially identified in [Debian bug #1097250], PGPLOT is affected
by build failures caused by mismatching prototypes with Gcc 15:

	In file included from PGPLOT.xs:16:
	pgfun.c: In function ‘pgfun1’:
	pgfun.c:78:7: warning: old-style function definition [-Wold-style-definition]
	   78 | float pgfun1(x)
	      |       ^~~~~~
	pgfun.c:79:4: error: number of arguments doesn’t match prototype
	   79 |    float *x; {
	      |    ^~~~~
	pgfun.c:29:7: error: prototype declaration
	   29 | float pgfun1();
	      |       ^~~~~~
	pgfun.c: In function ‘pgfun2’:
	pgfun.c:120:7: warning: old-style function definition [-Wold-style-definition]
	  120 | float pgfun2(x)
	      |       ^~~~~~
	pgfun.c:121:4: error: number of arguments doesn’t match prototype
	  121 |    float *x; {
	      |    ^~~~~
	pgfun.c:30:7: error: prototype declaration
	   30 | float pgfun2();
	      |       ^~~~~~
	pgfun.c: In function ‘pgfunplot’:
	pgfun.c:161:6: warning: old-style function definition [-Wold-style-definition]
	  161 | void pgfunplot(visible,x,y,z)
	      |      ^~~~~~~~~
	pgfun.c:163:4: error: number of arguments doesn’t match prototype
	  163 |    float *x,*y,*z; {
	      |    ^~~~~
	pgfun.c:31:8: error: prototype declaration
	   31 | void   pgfunplot();
	      |        ^~~~~~~~~

This patch adds missing function argument types in prototypes, and
casts a couple of indirect function calls, to ensure compatibility
with the standard C 2023, now selected by default by gcc 15 and later.

[Debian bug #1097250]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1097250

Signed-off-by: Étienne Mollier <emollier@debian.org>
@emollier
Copy link
Contributor Author

I had a peek at the failing integration tests on Ubuntu, but I believe the failure is unrelated:

  /usr/bin/ld: cannot find -lX11: No such file or directory

I'm under the impression that the severe coverage regression is caused by some of the failing Ubuntu tests, although honestly I'm not too sure what went wrong precisely.

Anyways, in hope this helps,
Have a nice day, :)
Étienne.

@mohawk2
Copy link
Member

mohawk2 commented Feb 25, 2025

Thank you! As soon as the CI finishes a second time (PDL's CI removed X11, so I had to add X11 for this module's CI), I'll merge.

@mohawk2 mohawk2 merged commit dd37c3e into PDLPorters:master Feb 25, 2025
7 checks passed
mohawk2 added a commit that referenced this pull request Feb 25, 2025
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.

None yet

2 participants