Question

I have a declaration like this:

extern "C++" CHARSET_INFO compiled_charsets[];

which compiled fine so far, but now with the update to XCode 5.1 I get an error for that:

.../my_sys.h:277:27: Definition of variable with array type needs an explicit size or an initializer

It's certainly just a newly enabled LLVM check, but I'm curious to know how you would cope with such an error in general, especially if that is in a 3rd party header file you can't change. But also if you could change it what would it look like? I mean, how can I initialize an external array? It's defined somewhere else. It makes no sense to initialize the external reference.

Was it helpful?

Solution

Found the solution myself. Not sure why is LLVM having trouble with this but removing the "C++" part makes it compile that code again:

extern CHARSET_INFO compiled_charsets[];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top