-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
termcap: fix build with gcc15 #478354
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
Open
eljamm
wants to merge
1
commit into
NixOS:master
Choose a base branch
from
eljamm:fix/termcap-gcc15
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+114
−3
Open
termcap: fix build with gcc15 #478354
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
pkgs/by-name/te/termcap/0001-Fix-too-many-arguments-to-function-with-GCC15-C23.patch
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| From e97ea05a5c72255ef858c4f21fea41347061e627 Mon Sep 17 00:00:00 2001 | ||
| From: eljamm <[email protected]> | ||
| Date: Fri, 9 Jan 2026 11:00:14 +0100 | ||
| Subject: [PATCH] Fix too many arguments to function with GCC15, C23 | ||
|
|
||
| The ISO C23, which is the default in GCC 15, changes the meaning of an | ||
| empty argument list from an unspecified list to no arguments, thus | ||
| breaking the build. | ||
|
|
||
| This patch fixes that by specifying all the arguments. | ||
|
|
||
| Note: this fix was possible thanks to a similar patch: | ||
| https://github.com/NixOS/nixpkgs/blob/ed124dcd6e5e07395c7d7ec77cd54a962f59bedc/pkgs/by-name/sh/sharutils/gcc15-c23-port.patch | ||
| --- | ||
| termcap.c | 15 ++++++--------- | ||
| termcap.h | 14 +++++++------- | ||
| tparam.c | 2 +- | ||
| 3 files changed, 14 insertions(+), 17 deletions(-) | ||
|
|
||
| diff --git a/termcap.c b/termcap.c | ||
| index 1a90751..fca0e5e 100644 | ||
| --- a/termcap.c | ||
| +++ b/termcap.c | ||
| @@ -126,7 +126,7 @@ xrealloc (ptr, size) | ||
| for tgetnum, tgetflag and tgetstr to find. */ | ||
| static char *term_entry; | ||
|
|
||
| -static char *tgetst1 (); | ||
| +static char *tgetst1 (char *ptr, char **area); | ||
|
|
||
| /* Search entry BP for capability CAP. | ||
| Return a pointer to the capability (in BP) if found, | ||
| @@ -314,10 +314,7 @@ static int speeds[] = | ||
| #endif /* not emacs */ | ||
|
|
||
| void | ||
| -tputs (str, nlines, outfun) | ||
| - register char *str; | ||
| - int nlines; | ||
| - register int (*outfun) (); | ||
| +tputs (register char *str, int nlines, register int (*outfun) (int)) | ||
| { | ||
| register int padcount = 0; | ||
| register int speed; | ||
| @@ -389,10 +386,10 @@ struct termcap_buffer | ||
|
|
||
| /* Forward declarations of static functions. */ | ||
|
|
||
| -static int scan_file (); | ||
| -static char *gobble_line (); | ||
| -static int compare_contin (); | ||
| -static int name_match (); | ||
| +static int scan_file (char *str, int fd, struct termcap_buffer *bufp); | ||
| +static char *gobble_line (int fd, struct termcap_buffer *bufp, char *append_end); | ||
| +static int compare_contin (char *str1, char *str2); | ||
| +static int name_match (char *line, char *name); | ||
|
|
||
| #ifdef VMS | ||
|
|
||
| diff --git a/termcap.h b/termcap.h | ||
| index b19fb0a..5726cd9 100644 | ||
| --- a/termcap.h | ||
| +++ b/termcap.h | ||
| @@ -39,23 +39,23 @@ extern char *tgoto (const char *cstring, int hpos, int vpos); | ||
|
|
||
| #else /* not __STDC__ */ | ||
|
|
||
| -extern int tgetent (); | ||
| +extern int tgetent (char *buffer, const char *termtype); | ||
|
|
||
| -extern int tgetnum (); | ||
| -extern int tgetflag (); | ||
| -extern char *tgetstr (); | ||
| +extern int tgetnum (const char *name); | ||
| +extern int tgetflag (const char *name); | ||
| +extern char *tgetstr (const char *name, char **area); | ||
|
|
||
| extern char PC; | ||
| extern short ospeed; | ||
|
|
||
| -extern void tputs (); | ||
| +extern void tputs (const char *string, int nlines, int (*outfun) (int)); | ||
|
|
||
| -extern char *tparam (); | ||
| +extern char *tparam (const char *ctlstring, char *buffer, int size, ...); | ||
|
|
||
| extern char *UP; | ||
| extern char *BC; | ||
|
|
||
| -extern char *tgoto (); | ||
| +extern char *tgoto (const char *cstring, int hpos, int vpos); | ||
|
|
||
| #endif /* not __STDC__ */ | ||
|
|
||
| diff --git a/tparam.c b/tparam.c | ||
| index 5a9809a..3d35bf3 100644 | ||
| --- a/tparam.c | ||
| +++ b/tparam.c | ||
| @@ -88,7 +88,7 @@ xrealloc (ptr, size) | ||
|
|
||
| The fourth and following args to tparam serve as the parameter values. */ | ||
|
|
||
| -static char *tparam1 (); | ||
| +static char *tparam1 (char *string, char *outstring, int len, char *up, char *left, int *argp); | ||
|
|
||
| /* VARARGS 2 */ | ||
| char * | ||
| -- | ||
| 2.51.2 | ||
|
|
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
Oops, something went wrong.
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.
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.
Now that I think about it, perhaps a better solution would be to change the std, similar to what fedora does?