[vbox-dev] reserved identifier violation

Knut St. Osmundsen bird at sun.com
Mon Feb 23 06:38:57 PST 2009


Hi Markus.

Markus Elfring wrote:
> Knut St. Osmundsen wrote:
>> Let me start saying that we're actively trying to avoid clashes with  
>> the C and C++ namespaces. We're aware that the current code contains  
>> violations, __BEGIN_DECLS being a prominent example, but they will be  
>> corrected before too long I hope.
> 
> Thanks for this acknowledgement.
> 
> Would you like to reopen the corresponding bug report?
> http://www.virtualbox.org/ticket/3304

I don't think that is necessary.

> Will any software developer or code reviewer be assigned to the issue in the
> near future?

Cannot answer that one.

> 
>> The reason why we used it in the first place is that, as  
>> mentioned earlier, some team members have a history from C/C++/Unix  
>> runtime development and found sys/cdefs.h and its __BEGIN_DECLS (from  
>> *BSD) to be a useful replacement for the three line #ifdef __cplusplus 
>> \n extern "C" {\n #endif block.
> 
> Should other software projects look also closer to their applications of naming
> conventions?

That is something those project will have to decide on their own.

>>> http://en.wikipedia.org/wiki/Include_guard#Difficulties
>> We use ___[DIR_]FOO_H, not __FOO_H. That's miscommunication from our side.
>> We do not see this as an invasion of the compiler / system namespace.
> 
> Well, it seems to be hard to distinguish three leading underscores from two.   ;-)

Agree. :-)

> How do you think about to move them from the beginning of the symbols to the end
> or to add a suffix "_INCLUDED"?

I've seen the latter practiced in some projects. We've decided to move
the guard macros out of the commonly used namespace to discourage any
use of them.

> Would you like to extend the mentioned ban for this use case instead?

No.

Kind Regards,
 knut

Sun Microsystems GmbH        Knut St. Osmundsen
Werkstrasse 24               Senior Staff Engineer, VirtualBox
71384 Weinstadt, Germany     mailto:bird at sun.com


================================================
Sitz der Gesellschaft: Sun Microsystems GmbH,
Sonnenallee 1, 85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schroeder,
Wolfgang Engels, Dr. Roland Boehmer
Vorsitzender des Aufsichtsrates: Martin Haering
================================================




More information about the vbox-dev mailing list