Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2003-07-15 15:47:22


On Tue, 15 Jul 2003 22:22:03 +0200, Peter Dimov wrote:

> Daniel Frey wrote:
>>
>> To explain the bug a bit: When you create a small test case, you'll
>> probably get the error from the compiler you are looking for. If you
>> put
>> the checked_delete in it's own header, it still works as long as you
>> include the header with
>>
>> #include "my_header.h"
>>
>> but if you use
>>
>> #include <my_header.h>
>>
>> and compile it with -I. then the compiler magically accepts
>> sizeof(Incomplete) with no warnings or errors and returns 0 as the
>> size.
>
> Looks like a "feature" to me. Apparently some important system header
> does sizeof(incomplete).

"It's not a bug, it a feature!" (tm) ;)

I know they will find a convincing excuse, but that doesn't help us as we
create a library which is usually used through <> instead of "".

>> To work around this, I added a simple STATIC_ASSERT which - for some
>> reason - still works :)
>
> Odd, since the Intel-specific BOOST_STATIC_ASSERT is
>
> [snip]
>
> which looks pretty close to what checked_delete uses.

That's correct. I don't know why it works in one case but not in the
other. But we've seen stranger bugs already, haven't we? :))

>> +#include <boost/config.hpp>
>> +#if defined(BOOST_INTEL)
>> +#include <boost/static_assert.hpp>
>> +#endif
>
> Dependencies. I hate dependencies.

Do you have a better idea?

Regards, Daniel


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