This is the mail archive of the
mailing list for the GCC project.
Re: GNU C: Implicit int and implicit function definitions
- From: Andrew Haley <aph at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 20 May 2016 10:08:05 +0100
- 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>
On 05/20/2016 10:02 AM, Florian Weimer wrote:
> On 05/20/2016 10:30 AM, lh mouse wrote:
>> Implicit function declarations result in warnings since C99 or GNU99 and '-pedantic-errors' turns them into errors.
>> The same goes for implicit return types.
> The warnings typically do not stop the build, and thus are not really
> helpful when you are looking at binaries.
C99 Rationale sez:
A new feature of C99: In C89, all type specifiers could be omitted
from the declaration specifiers in a declaration. In such a case
int was implied. The Committee decided that the inherent danger of
this feature outweighed its convenience, and so it was removed. The
effect is to guarantee the production of a diagnostic that will
catch an additional category of programming errors. After issuing
the diagnostic, an implementation may choose to assume an implicit
int and continue to translate the program in order to support
existing source code that exploits this feature.
Given this, I do not understand why GCC does not treat implicit int as
a hard error.