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

Pygame fails to compile with GCC-14 #4227

Closed
NHOrus opened this issue May 9, 2024 · 4 comments · Fixed by #4236
Closed

Pygame fails to compile with GCC-14 #4227

NHOrus opened this issue May 9, 2024 · 4 comments · Fixed by #4236
Labels
bug gentoo gentoo linux operating system

Comments

@NHOrus
Copy link

NHOrus commented May 9, 2024

Environment:

  • Operating system: Linux(Gentoo)
  • Python version 3.12.3
  • SDL version 2.30.3
  • PyGame version 2.5.2
  • GCC Version: 14.1.0

Current behavior:

Fails to compile with error

Expected behavior:

GCC-14 added now errors when encountering long-deprecated C features. It encountered one in pygame:

Stack trace/error output/other error logs

src_c/pypm.c: In function ‘__pyx_pf_6pygame_4pypm_5Input___init__’:
src_c/pypm.c:7236:82: error: passing argument 5 of ‘Pm_OpenInput’ from incompatible pointer type [-Wincompatible-pointer-types]
 7236 |   __pyx_v_err = Pm_OpenInput((&__pyx_v_self->midi), __pyx_t_2, NULL, __pyx_t_3, (&Pt_Time), NULL);
      |                                                                                 ~^~~~~~~~~
      |                                                                                  |
      |                                                                                  PtTimestamp (*)(void) {aka int (*)(void)}
In file included from src_c/pypm.c:1235:
/usr/include/portmidi.h:399:31: note: expected ‘PmTimeProcPtr’ {aka ‘int (*)(void *)’} but argument is of type ‘PtTimestamp (*)(void)’ {aka ‘int (*)(void)’}
  399 |                 PmTimeProcPtr time_proc,
      |                 ~~~~~~~~~~~~~~^~~~~~~~~

expected signature, as it's not obvious from above:

PMEXPORT PmError Pm_OpenInput(PortMidiStream** stream,
                PmDeviceID inputDevice,
                void *inputDriverInfo,
                int32_t bufferSize,
                PmTimeProcPtr time_proc,
                void *time_info);
@NHOrus NHOrus added the bug label May 9, 2024
@illume
Copy link
Member

illume commented May 18, 2024

Thanks for the bug report.

I can compile it with gcc 14.0.1 on Ubuntu 24.04. So maybe it's related to Gentoo or gcc 14.1.0.

Do you know what portmidi version it is? Could be a change there too.

@illume illume added the gentoo gentoo linux operating system label May 18, 2024
@illume
Copy link
Member

illume commented May 18, 2024

I see the gentoo bug here: https://bugs.gentoo.org/926650

@NHOrus
Copy link
Author

NHOrus commented May 18, 2024

I have portmidi 2.0.4. Released in 2022. It was the one pygames was build in original gentoo bug, too.
No idea whats "1:217-6.1build3" from Ubuntu is relative to that. Quick look at the sources dates them october 2010 at the latest, with Debian patches from 2016.

@illume
Copy link
Member

illume commented May 19, 2024

Thanks @NHOrus that seems to be the issue. After fixing that (#4236), it compiles all the way through with gcc-14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gentoo gentoo linux operating system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants