This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GNU C: Implicit int and implicit function definitions
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Fri, 20 May 2016 20:41:01 +0000
- Subject: Re: GNU C: Implicit int and implicit function definitions
- Authentication-results: sourceware.org; auth=none
- References: <2dd49b4d-0722-bbcd-0e0d-dd6eb690e43d at redhat dot com> <8ece086 dot 152397 dot 154cd497482 dot Coremail dot lh_mouse at 126 dot com> <c92fa1f3-99e0-78b6-02c7-c3fb4cdad273 at redhat dot com> <573ED3F5 dot 70102 at redhat dot com>
On Fri, 20 May 2016, Andrew Haley wrote:
> Given this, I do not understand why GCC does not treat implicit int as
> a hard error.
Because in C the existing practice has been that we support the union of
all features and extensions that can sensibly be supported with the given
language version (these are warnings (pedwarns) by default in C99 mode,
not restricted to -pedantic). It's possible that C code used in practice
has changed sufficiently over the years that continuing to build legacy
code using these features (while using default compiler options, which now
imply -std=gnu11) is less of a concern; information about how many
warnings for implicit int and implicit function declarations there are in
distribution builds would be useful.
C++ has various standard-required-diagnostics as permerrors (error by
default, warning with -fpermissive). That might be a plausible model for
C as well (there are plenty of always-on pedwarns, some of which could be
considered for making into permerrors), though in the present case we
already have more specific options for these diagnostics.
--
Joseph S. Myers
joseph@codesourcery.com