Bug 2309495 - Missing stdio.h include
Summary: Missing stdio.h include
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: readline
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Siteshwar Vashisht
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2309077
TreeView+ depends on / blocked
 
Reported: 2024-09-03 16:20 UTC by Artur Frenszek-Iwicki
Modified: 2024-09-20 09:19 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-09-20 09:04:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Package Sources readline pull-request 15 0 None None None 2024-09-19 08:41:44 UTC

Description Artur Frenszek-Iwicki 2024-09-03 16:20:57 UTC
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.

Comment 1 Michel Lind 2024-09-19 08:27:39 UTC
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.

Comment 2 Michel Lind 2024-09-19 08:41:45 UTC
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.

Comment 3 Michel Lind 2024-09-19 08:42:36 UTC
also needinfo-ing Lukáš who for some reason is not on the Cc: for this but is listed as a maintainer

Comment 4 Michel Lind 2024-09-20 09:04:28 UTC
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.

Comment 5 Artur Frenszek-Iwicki 2024-09-20 09:19:46 UTC
My package is already patched, so if upstream is adamant that users should include stdio.h themselves, then I'm fine with closing this.


Note You need to log in before you can comment on or make changes to this bug.