[Bug c/96284] Outdated C features should be made errors with newer standards
egallager at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jul 28 05:57:09 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96284
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org,
| |fw at gcc dot gnu.org
--- Comment #5 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to David Brown from comment #0)
> While C has tried to remain backwards compatible with each new standards
> revision, some changes have been made so that particularly unsafe features
> from old code are no longer supported. gcc has (reasonably enough) tried to
> keep support for old features, but when something has been deprecated for
> decades, perhaps it is time for it to be treated as an error by default and
> require an explicit flag. (This is in the same style as bug 85678 making
> "-fno-common" the default.)
>
> For example, implicit function declarations from K&R C were made obsolescent
> in C90, and removed from the language in C99. But by default, they still
> only cause a warning (-Wimplicit-function-declaration) in gcc, no matter
> what standard is picked.
>
> Could this be made an error by default
> (-Werror=implicit-function-declarations) ? Let those who want to compile
> old code with implicit function declarations, do so with an explicit flag.
I think Florian Weimer tried this and it broke the majority of configure
scripts in existence...
More information about the Gcc-bugs
mailing list