Boost logo

Boost :

Subject: Re: [boost] Mixed use of "include" directives with quoted vs. angle-bracketed params, causing havoc
From: John Maddock (john_at_[hidden])
Date: 2008-09-07 06:35:15


Victor V. Terber wrote:
>> John Maddock wrote:
>>> So that's +1 for <> from me too.
>>
>> +1 from me as original poster also.
>>
>> A bit grepping suggests that the angle-bracketed form is used much
>> more widely than the quoted one inside Boost.
>>
>> But there is a catch: In many places "include SOMEMACRO" is used,
>> which
>> often (mostly?) expands into quoted parameters. An example is macro
>> "BOOST_PP_STRINGIZE" used with "include" at over a dozen locations
>> inside
>> MPL (this actually blew up my configuration in the first place).
>>
>> A nice example is also BOOST_COMPILER_CONFIG and friends. While in
>> file boost\config\user.hpp its use is proposed with angle brackets,
>> the actual defines in boost\config\select_compiler_config.hpp are
>> quoted.

Oh :-(

That would be me, I seem to remember there was actually a reason for this,
if you use

#include <somename.hpp>

and "somename" happens to be a macro then it gets macro expanded, and there
are some platforms that define for example:

#define linux 1

which causes:

#include <boost/config/platform/linux.hpp>

to blow up :-(

The only workaround would be to obfuscate the file names to
boost_linux_config.hpp or something which is equally ugly ("linux" isn't the
only culptrit BTW, but is the most common one).

>> As I'm new to the Boost devel process: Should I (or anyone else)
>> enter a ticket, or doesn't that make sense before further discussion
>> occurred? _______________________________________________

Well, since it's provoked some discussion, lets see what happens....

Cheers, John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk