public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* function calls before variable declarations does not give error in gcc?
@ 2004-08-31  3:58 Oza Dhairesh
  2004-08-31  5:22 ` Eljay Love-Jensen
  0 siblings, 1 reply; 4+ messages in thread
From: Oza Dhairesh @ 2004-08-31  3:58 UTC (permalink / raw)
  To: gcc-help

Hi,

The following code does not give an error wth gcc

void fun(int a){ printf("there u go %d\n",a);}

int main()
{
        char abc[10] = "the";
        int a1 = 10;
        fun(10);
        int a = 1;
} 

gcc --version gave the following o/p:

gcc (GCC) 3.3.1 (SuSE Linux)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

while wth a compiler that gave the following o/p wth gcc --version
2.96

I got the following error:
test1.c: In function `main':
test1.c:10: parse error before `int'

why this difference?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-31 12:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-31  3:58 function calls before variable declarations does not give error in gcc? Oza Dhairesh
2004-08-31  5:22 ` Eljay Love-Jensen
2004-08-31  6:31   ` Oza Dhairesh
2004-08-31 12:18     ` Eljay Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).