The proposal to enable -Wstrict-prototypes discussed below was considered too late for GCC 8. I'd like to revive it now for GCC 9.
https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00935.html On 01/11/2018 11:41 AM, Martin Sebor wrote:
Declaring a function without a prototype has been deprecated for nearly two decades (since C99) and may be removed from the C language in C2X. To prompt programs to transition to the more modern and safer style, PR 82922 requests to enable Wstrict-prototypes in -Wextra. With the recent changes to add prototypes to a handful of functions in Go and libgo, GCC bootstraps with the option on x86_64 but there are a number of testsuite failures. The attached patch either avoids or, in a small number of instances, prunes out the warnings to let the tests pass on x86_64. It's possible that enabling the option could cause bootstrap to break on other targets but since (if) only libraries are compiled as C code anymore and not GCC back-end code, it seems unlikely. Handling such cases is also trivial, so unless I'm missing something, enabling the option should be low risk for GCC. It seems more plausible that are tests for other targets that would fail with the option, but if the the small number of x86_64-specific tests in the patch is any indication (AFAICS just 1) they could be dealt with as they are uncovered during testing with only a minimum of disruption. Assuming there is consensus to enable -Wstrict-prototypes, does enabling the option and dealing with individual failures case- by-case sound like a reasonable approach, or are are there other/better ways to proceed without a lot of overhead that I'm not thinking of? I'm in the process of testing powerpc64le but I don't have the ability or the cycles to do other targets. Martin