Re: about arrays initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux