http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51440



--- Comment #5 from Martin Richtarsky <gcc at martinien dot de> 2013-03-30 
22:06:48 UTC ---

Hi Manuel,



thanks for the pointers how to add the optional warning. I will try to submit a

patch, however first I would like to understand what is going on exactly:



- the volatile qualifier (could also be const) leads to internal linkage

- C++ has a default namespace for each translation unit where any code will be

located that has no explicit namespace, and the warning here says that this

structure will be local to this namespace for each translation unit that

includes it the header



Is this correct?



Would there be any kind of workaround to change this without removing the

volatile keyword?



I tried these:

- wrapping the include in extern "C": doesn't work



- wrapping the include in an explicit namespace statement: works





Best regards,

Martin

Reply via email to