Eli Schwartz <eschwart...@gmail.com> writes:

> GNU C does not define any such thing. It may happen to turn out that
> way, but that is not the same as defining its behavior.

It is.

>> Nor does GCC conform to the Standard by default: while it is okay for a
>> conforming implementation to translate programs relying on implicit int,
>> as there is no way doing so will alter the behavior of any strictly
>> conforming program, it is not okay to reserve keywords such as `asm'.
>> 
>> The following strictly conforming program is thus not acceptable to GCC,
>> unless GCC is operating in standards-conformance mode:
>> 
>>   int
>>   main (argc, argv)
>>   int argc;
>>   char **argv;
>>   {
>>     int asm;
>>     return asm = 0;
>>   }
>> 
>> which shows that debating features based on the Standard is entirely
>> pointless, as the Standard allows implementations to provide almost
>> anything it prohibits.
>
>
> Sure, all I have to do is tell GCC to act like a C compiler.
>
>
> $ gcc -std=c2x /tmp/po.c -o /tmp/po; /tmp/po; echo $?
> /tmp/po.c: In function ‘main’:
> /tmp/po.c:2:3: warning: old-style function definition
> [-Wold-style-definition]
>     2 |   main (argc, argv)
>       |   ^~~~
> 0

No, all you have to do is to tell GNU CC to compile Standard C.  But
what's being debated here is the behavior of GNU CC when translating
both Standard C and GNU C, so your demonstration is almost completely
pointless.

Btw, try to compile any program using inline assembler, and you will
quickly find out how many programs depend on the (gasp!) non-conformant
behavior of GNU C.

> But I don't understand what point you are trying to make, anyway. The
> Standard allows, but does not require, implementations to do many things
> if it so chooses. GNUC takes advantage of this when operating in GNUC
> mode, when also documenting GNUC features in the HTML docs.

[...]

> What does this have to do with implicit-int, which is a constraint
> violation? Where in the GNUC html documentation does it say that
> constraint violations applied to Type specifiers have been carved out as
> a GNUC extension?

As I said, what the Info documentation does not say is completely
irrelevant.  I might as well ask you: where in (gcc)C Extensions is it
said that the documentation describes each and every extension and
aspect of GNU C?

The documentation is supposed to describe the behavior of the
translator, not to specify it.

> It's not a GNUC extension, you cannot assume it will work. It might work
> anyway, but that's a matter of luck.

It _is_, regardless of what you might say.

> It is unclear why you are overly focused on implicit-int, to be honest.

Because there is a point to be made for discouraging implicit function
declarations.  Certainly not enough to make them errors in GNU C, but
enough to justify their obsolescence in the ANSI Standard.

There is none whatsoever for discouraging implicit int.  Its
obsolescence and later removal was simply the act of a overzealous
Committee, deviating too far from its task of standardizing existing
practice.

> But your arguments in favor of implicit-int aren't very compelling either.

Tell me how?

Reply via email to