about arrays initialization
Tim Prince
n8tm@aol.com
Sat Aug 27 14:41:00 GMT 2011
On 8/27/2011 10:27 AM, uulinux wrote:
> At first, read my code following please.
> ===============================================
> #include<stdio.h>
> int main()
> {
> int a[5]={1, 2, 3, a[2], a[0]+a[1]};
> int i=0;
>
> for (i=0; i<5; i++) {
> printf("\t%d", a[i]);
> }
> return 0;
> }
> ===============================================
>
> There are not any error or warning log shown during compiling.
$ gcc -c -pedantic uul.c
uul.c: In function `main':
uul.c:5: warning: initializer element is not computable at load time
uul.c:5: warning: initializer element is not computable at load time
You must not have invoked your gcc as a C compiler.
--
Tim Prince
More information about the Gcc-help
mailing list