Pplease could explain

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

 



Good morning.
I'm having troubles with "initializer element is not constant".
There is a way to make the compiler knows the second construct (*b) is
also constant?

Please, CC to my email address.

typedef struct foo {
	const unsigned char *bar;
} foo;

int main()
{
	static const unsigned char a[]="aaa";
	static const unsigned char *b="bbb";

	static const foo f[]={
		{ a, },
		{ b, },
	};

}

Best regards,
 Andrea Baldoni

[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