http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53493
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-26 19:26:27 UTC --- > I'm pretty sure that the C++ standard does not specify that separate > compilation should break unless all const variables are used in the > compilation > unit where they are defined. It defines them if they have const keyword, they have to be defined in each translational unit. If not then the one where it is declared has to be marked extern. Something like: extern unsigned char const foo[4]; unsigned char const foo[4] = { 'f', 'o', 'o', 0 }; ---- CUT ---- is required and that turns the linkage to be external. Otherwise foo has vague linkage (a C++ term saying it has to be the same in each translational unit that it is used).