-
Notifications
You must be signed in to change notification settings - Fork 30
Fix compilation with C23-supporting compilers, eg. GCC-15 and Clang-19 #49
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
base: master
Are you sure you want to change the base?
Conversation
helmutg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for proposing fixes for gcc 15. This is a non-maintainer review and does not bear any authority.
This fails with GCC-15 and other compilers implementing C23 Added prefix gpm_ to raw() and noraw() used in two files because they are implemented in same two files, and are static. Same with scr_dump() and src_restore() in yacc source file
Fill empty argument lists with values. Add 0 as third argument for two-argument function, it will be ignored at call site.
|
Ok, removed the ncurses include commit, leaving behind two that aren't problematic. |
|
Whilst this MR is now incomplete, the parts it fixes are an improvement. Thus I issue a non-maintainer LGTM with no authority. |
Window handle is an opaque pointer that Gpm_Wgetch() passes through straight to ncurses if it's not null and calls getch if it's null. Code doesn't care what's inside the handle as long as it agrees with curses definition.
|
I had a brilliant idea. |
| * if it's null. Code doesn't care what's inside the handle | ||
| * as long as it agrees with curses definition. | ||
| */ | ||
| typedef struct _win_st WINDOW; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered this as well, but it has two downsides.
If you also include curses.h, you have two typedefs and that doesn't make gcc happy.
It also exposes ncurses internals and breaks if ncurses ever renames its struct _win_st to something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we can't split this declaration off into new header that's only optionally included, because ncurses straight-up checks for decl presence.
Can we ask ncurses to drop dependency on gpm? Or, you know, take the gpm and merge it into ncurses codebase...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can take a void* here and cast it to WINDOW* in the .c file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can ncurses check for a different declaration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can take a
void*here and cast it toWINDOW*in the .c file.
Yes, that's what I will upload to debian
Patch from telmich/gpm#49
Fixes errors that were warnings, once.