[cfe-dev] Type qualifiers

Umesh Kalappa umesh.kalappa0 at gmail.com
Wed Aug 1 23:24:00 PDT 2012


Hi Guys ,

gcc pop up with the  error for the below sample

[root at insiscssgs06 ~]# cat  test.c
int main()
{
 int i ;
 int a[ const i =10] ;
 while (i <10)
 a[i++]=i;
}

[root at insiscssgs06 ~]# gcc  test.c
test.c: In function âmainâ:
test.c:4: error: static or type qualifiers in non-parameter array declarator

[root at insiscssgs06 ~]# gcc  --version
gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)

But ,The same compiles with clang

[root at insiscssgs06 ~]# clang --version
clang version 3.2 (trunk) (llvm/trunk 158444)
Target: i386-pc-linux-gnu
Thread model: posix
[root at insiscssgs06 ~]# clang test.c

According to c99 in the section 6.7 the clang is right.Before i report a
bug in the  GCC .Any thoughts or inputs or suggestions ???

Please forgive me ,if its not the right group.

Thanks
~Umesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120802/532cff42/attachment.html>


More information about the cfe-dev mailing list