Bug 31417 - sim: -Wstrict-prototypes not enabled due to bad configure check
Summary: sim: -Wstrict-prototypes not enabled due to bad configure check
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: sim (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-26 14:54 UTC by Simon Marchi
Modified: 2024-02-26 15:05 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Marchi 2024-02-26 14:54:01 UTC
The sim directory attempts to enable the -Wstrict-prototypes compiler flag.  While it is support in gcc, the flag is not enabled because the config check results in:

configure:16654: ccache gcc -c -g3 -O0 -fsanitize=address -fmax-errors=1 -fdiagnostics-color=always     -Werror -Wstrict-prototypes  co
nftest.c >&5
conftest.c:163:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
  163 | main ()
      | ^~~~

The main function in the config test is:

| int
| main ()
| {
| 
|   ;
|   return 0;
| }


So yeah, the flag is not enabled because it finds in the config test exactly the kind of things it's meant to find :)
Comment 1 Simon Marchi 2024-02-26 15:05:30 UTC
I think that this could be fixed by migrating to autoconf >= 2.70, thanks to this commit:

https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=1717921aa6c1ef559ef494675f6d1b20c2ae389e