Boost logo

Boost :

From: Simon Buchan (simon_at_[hidden])
Date: 2005-10-13 04:53:15


Martin Wille wrote:
> Thomas Andersen wrote:
>
>>I have tried to get wave to preprocess the boost headers. However I get an
>>error in cstdint.hpp line 246
>>
>># if ULONG_MAX == 18446744073709551615 // 2**64 - 1
>>
>>error: ill formed integer literal or integer constant too large:
>>18446744073709551615
>>
>>Have anybody else encountered this problem, and found a way around it?
>
>
> On 32 bit system, an unsigned long can't be == 18446744073709551615.
> Even on a 64 bit system, the literal 18446744073709551615 would be
> signed. The code probably should read
>
> # if ULONG_MAX == 18446744073709551615ULL
>
> on systems that allow for 'long long'.
>
You mean UL (For all of them, this is checking for the biggest possible
unsigned long, remember?). However the standard says integer literals
will choose the smallest type that can hold them, signed first, so that
will be chosen implicitly anyway for the actual value.

Unrepresentable literals should be a warning, not an error, anyway (and,
obviously (now), only if the code is actually compiled).

PS: what happens for systems with funky dword sizes, like 28? (I think
there still are _some_ around)

PPS: Why isn't that written as 0xffffffffffffffff?


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