This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
function calls before variable declarations does not give error in gcc?
- From: Oza Dhairesh <dhairesh at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 31 Aug 2004 08:52:51 +0530
- Subject: function calls before variable declarations does not give error in gcc?
- Reply-to: Oza Dhairesh <dhairesh at gmail dot com>
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?