This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GNU C: Implicit int and implicit function definitions


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.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]