Why error "variable previously declared ‘static’ redeclared ‘extern’"?

Alec Teal a.teal@warwick.ac.uk
Mon Jul 7 14:19:00 GMT 2014


All wrong:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf

Top of page 144.

GCC is basically saying "you said it was static, but here it is extern!" 
which is a contradiction.

Clang probably doesn't look for it because ... well it's not a common 
error, perhaps a linker error later in the build, there really is no 
sensible thing to do if something that is supposed to be static suddenly 
becomes extern, the two terms are mutually exclusive.

Alec



More information about the Gcc-help mailing list