|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-08-12 13:26:48
Jonathan Wakely <cow_at_[hidden]> writes:
> On Thu, Aug 12, 2004 at 05:15:41PM +0200, Markus Sch?pflin wrote:
>
>> >(No sigaction (XSH4.0), no nanosleep (P1003.1b), and no
>> >clock_gettime(P1003.1b), to get those you have to define _XOPEN_SOURCE
>> >or _POSIX_SOURCE or some such.)
>>
>> [snip]
>>
>> I have been doing some more research on this. When _PURE_CNAME is in
>> effect (which it is when using "-std strict_ansi") there is no way (read
>> as: I didn't find one) to get at those functions, no matter how you
>> define _XOPEN_SOURCE or _POSIX_SOURCE because the C++ compiler brings
>> its own set of C header files which don't include the system header
>> files in that case.
>
> Ouch! so strict_ansi means "strict ANSI and nothing else, if it wasn't
> listed in ISO 14882 it doesn't exist and you're not allowed to use it,
> in fact, you shouldn't even know about it. Who told you there was a
> function called nanosleep?"
>
> I suppose it means you can write a program that includes names such as
> nanosleep in the global namespace without getting unintened clashes from
> the standard headers. But it would be nice if there was an alternative
> way of getting at the POSIX etc. names.
>
>> Therefore this option is out of question, I think.
>
> You've convinced me, I'll shut up :)
Should we consider a setup where the default for user code is strict
ansi, but libraries are compiled with whatever options are needed to
make those declarations available when needed?
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk