This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
GCC-ANSI C conflict
- From: Sankara Rameswaran <sankar dot netsoft at gmail dot com>
- To: GCC BUGS <gcc-bugs at gcc dot gnu dot org>
- Date: Thu, 16 Jun 2005 10:05:42 +0530
- Subject: GCC-ANSI C conflict
- Reply-to: Sankara Rameswaran <sankar dot netsoft at gmail dot com>
hi
according to ansi c standards all declarations have to to be at the
starting of the block..
which means the program below should not work.. i compiled this using gcc
>>gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
>>Copyright (C) 2004 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.
but it is working fine..
this might be fine with g++ but i used gcc...
int main()
{
int i;
scanf("%d",&i);
int a[i];
a[i-1]=128;
printf("%d",a[i-1]);
}
is this a bug or just for compatability with c++...
please clarify
expecting a reply...
--
Sankara Rameswaran,
Give more your ears less your voice