|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-04-23 17:01:35
Bronek Kozicki wrote:
> Peter Dimov wrote:
>> Indirectly. interlocked.hpp is included by shared_ptr.hpp on Windows.
>> Comeau doesn't compile it even without --a, because it doesn't seem
>> to recognize __stdcall. And since the functions that interlocked.hpp
>> attempts to import from the Windows kernel are indeed __stdcall, this
>> makes it impossible for interlocked.hpp to do its job.
>>
>> This can be fixed by defining BOOST_SP_DISABLE_THREADS for the Comeau
>> toolset.
>
> Are you sure? I tried very simple program using shared_ptr and it's OK
> in non-strict mode, but does not compile in strict mode. The only
> difference is --a switch. In strict mode it chokes on interlocked.hpp
> header, but apparently the very same header is accepted in non-strict
> mode. Which would mean that without --a switch Comeau knows how to
> deal with __stdcall. Actually I'm pretty sure that wihout --a como can
> compile program than includes Windows headers, I tried it more than
> once. Or maybe I misunderstood something and some different experiment
> would be relevant (but not the one shown below)?
No, you are right, como does compile interlocked.hpp without --a/--A. I was
mistaken. However:
> #include <boost/shared_ptr.hpp>
> struct A {};
> int main()
> {
> boost::shared_ptr<A> a = new A();
> }
your program is broken and should fail to compile, but doesn't. That's why I
still think that it's better to define BOOST_SP_DISABLE_THREADS instead of
omitting --a globally (and I'd even suggest --A.) There isn't much point
testing with Comeau otherwise; the idea is to use its strictness to find
bugs that other compilers miss.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk