When trying to compile a program using readline, compilation fails because of a missing include. Minimal reproducer: ``` #include <readline/readline.h> int main(void) { return 0; } ``` Expected result: The program compiles. Actual result: ``` In file included from /usr/include/readline/readline.h:36, from rdln.c:1: /usr/include/readline/rltypedefs.h:71:29: error: unknown type name ‘FILE’ 71 | typedef int rl_getc_func_t (FILE *); | ^~~~ /usr/include/readline/rltypedefs.h:1:1: note: ‘FILE’ is defined in header ‘<stdio.h>’; this is probably fixable by adding ‘#include <stdio.h>’ +++ |+#include <stdio.h> 1 | /* rltypedefs.h -- Type declarations for readline functions. */ /usr/include/readline/readline.h:450:21: error: unknown type name ‘FILE’ 450 | extern int rl_getc (FILE *); | ^~~~ /usr/include/readline/readline.h:39:1: note: ‘FILE’ is defined in header ‘<stdio.h>’; this is probably fixable by adding ‘#include <stdio.h>’ 38 | # include <readline/tilde.h> +++ |+#include <stdio.h> 39 | #endif /usr/include/readline/readline.h:591:8: error: unknown type name ‘FILE’ 591 | extern FILE *rl_instream; | ^~~~ /usr/include/readline/readline.h:591:8: note: ‘FILE’ is defined in header ‘<stdio.h>’; this is probably fixable by adding ‘#include <stdio.h>’ /usr/include/readline/readline.h:592:8: error: unknown type name ‘FILE’ 592 | extern FILE *rl_outstream; | ^~~~ /usr/include/readline/readline.h:592:8: note: ‘FILE’ is defined in header ‘<stdio.h>’; this is probably fixable by adding ‘#include <stdio.h>’ /usr/include/readline/readline.h:623:8: error: unknown type name ‘rl_getc_func_t’; did you mean ‘rl_cpcpfunc_t’? 623 | extern rl_getc_func_t *rl_getc_function; | ^~~~~~~~~~~~~~ | rl_cpcpfunc_t /usr/include/readline/readline.h:954:3: error: unknown type name ‘FILE’ 954 | FILE *inf; | ^~~~ /usr/include/readline/readline.h:954:3: note: ‘FILE’ is defined in header ‘<stdio.h>’; this is probably fixable by adding ‘#include <stdio.h>’ /usr/include/readline/readline.h:955:3: error: unknown type name ‘FILE’ 955 | FILE *outf; | ^~~~ /usr/include/readline/readline.h:955:3: note: ‘FILE’ is defined in header ‘<stdio.h>’; this is probably fixable by adding ‘#include <stdio.h>’ ``` Occurs on Rawhide with readline-8.2-11.fc42 and on F40 with readline-8.2-8.fc40.
I have a patch that works locally and have sent upstream; will put up a PR once the mail shows up in the mailing list archive so I can link it in a comment.
PR attached. Any maintainer - please take a look and merge and build this for Rawhide, F41 and F40, otherwise I'll do this in a few days to unbreak.
also needinfo-ing Lukáš who for some reason is not on the Cc: for this but is listed as a maintainer
From the readline dev, this is a bug in the applications themselves, as readline's info does clearly note applications have to include stdio.h themselves. Seems like prior to GCC 14 these apps transitively inherited stdio.h from some other paths but they have always been doing this wrong. What was the app you're trying to compile Artur? I'll patch jimtcl and upstream that patch, but this is not a readline bug.
My package is already patched, so if upstream is adamant that users should include stdio.h themselves, then I'm fine with closing this.