Skip to content

Fix build failure with GCC 15 (-std=gnu23)#53

Open
texasich wants to merge 4 commits intotelmich:masterfrom
texasich:fix/gcc15-c23-compat
Open

Fix build failure with GCC 15 (-std=gnu23)#53
texasich wants to merge 4 commits intotelmich:masterfrom
texasich:fix/gcc15-c23-compat

Conversation

@texasich
Copy link
Copy Markdown

@texasich texasich commented Apr 8, 2026

Summary

GCC 15 defaults to -std=gnu23, which introduces several breaking changes that prevent gpm from building. This PR fixes three classes of C23 compatibility issues:

1. Unprototyped function declaration (gpm.h)
Gpm_Wgetch() was declared with empty parentheses, which in C23 means (void). The actual definition takes a WINDOW * parameter. Fixed by forward-declaring struct _win_st (the underlying ncurses type) and adding a proper prototype, avoiding the need to include <curses.h> in the public header.

2. Missing void in old_main() declarations (daemon.h, old_main.c)
Same class of issue — empty () now means (void) in C23, causing conflicting type errors between declaration and definition.

3. Mismatched pointer type in gpm_convert_event (libcurses.c)
The local extern declaration used char * but the actual definition in liblow.c uses unsigned char *. GCC 15 flags this as an incompatible pointer type error.

Fixes #48

Reference

texasich added 4 commits April 7, 2026 22:47
GCC 15 defaults to -std=gnu23, where empty () means (void). Gpm_Wgetch was declared without parameters but defined with WINDOW*. Forward-declare struct _win_st to add a proper prototype without pulling in curses.h. Part of fix for telmich#48.
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.

Build failure with GCC 15 (defaults to -std=gnu23)

1 participant