This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Pplease could explain


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]