Fix build failure with GCC 15 (-std=gnu23)#53
Open
texasich wants to merge 4 commits intotelmich:masterfrom
Open
Fix build failure with GCC 15 (-std=gnu23)#53texasich wants to merge 4 commits intotelmich:masterfrom
texasich wants to merge 4 commits intotelmich:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aWINDOW *parameter. Fixed by forward-declaringstruct _win_st(the underlying ncurses type) and adding a proper prototype, avoiding the need to include<curses.h>in the public header.2. Missing
voidinold_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
externdeclaration usedchar *but the actual definition inliblow.cusesunsigned char *. GCC 15 flags this as an incompatible pointer type error.Fixes #48
Reference