Hi all,

Recent months I am trying mingw gcc 4.2.1 (experimental) and getting many 
warnings.
Most of them are obvious but some warnings about the use of the anonymous 
namespace 
possibly should be taken seriously.

We are using the anonymous namespace to hide the implementation but it may 
break the 
One Definition Rule in some cases.
(see the discussion in gcc bugzila 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29365)

If the class definition using types in the anonymous namespace is only used in 
one 
translation unit, especially in case the definition is in the main source, we 
are 
safe. If it is used in more than one translation unit, it may violates ODR. It 
is 
possible if the definition lies in an included source code. There are three 
cases in 
m239.

Maybe it is better to move the contents of 
dbaccess/source/core/misc/propertybag.hxx 
and ucb/source/inc/regexpmap.tpt to the main source respectively. They seem to 
be 
used in only single main source.

In the case of sd/source/ui/inc/DrawController.hxx, the only solution not to 
violate 
ODR seems to be making implementation visible. However, it may cause no problem 
if 
the pointers or the references are not passed across the translation units.

----
 Takashi Ono(HK Freak)
 mailto:[EMAIL PROTECTED] or [EMAIL PROTECTED]
        (Personal Address, checked every morning/evening and holidays)
 mailto:[EMAIL PROTECTED]
        (Address for business, checked every working days)
 http://www.hkfreak.net

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to