(Richard Bos) wrote:
>Hongzheng Wang <> wrote:
>
>> #include <stdio.h>
>>
>> int main()
>> {
>> int i = 1;
>> printf("%d\n", i);
>> int j = 0;
>> printf("hello %d\n", j);
>> return 0;
>> }
>>
>> When I compiled it using `gcc test.c -o test -std=c89 -Wall`, it did not
>> complained about this problem.
>
>Yes, IIRC Ganuck has this as an extension. It's not ISO C89, though.
Indeed: if gcc is invoked in conforming C89 mode [1] it emits the
required diagnostic.
[1] -W -Wall -O -std=c89 -pedantic
Regards
--
Irrwahn Grausewitz ()
welcome to clc:
http://www.ungerhu.com/jxh/clc.welcome.txt
clc faq-list :
http://www.faqs.org/faqs/C-faq/faq/
clc OT guide :
http://benpfaff.org/writings/clc/off-topic.html