[tor-dev] building from source in a 64-bit windows environment..
andrea at torproject.org
Mon May 20 18:40:38 UTC 2013
On Sat, May 18, 2013 at 11:55:48AM -0400, Zack Weinberg wrote:
> There's nothing wrong with sizeof(long) == sizeof(int), but I assure
> you that C89 does require sizeof(long) >= sizeof(void *) [more
> precisely, that a valid value of type 'void*' can be cast to 'unsigned
> long' and back without loss of information] provided also that the
> memory space is flat. It is not itself a spelled-out requirement in
> the standard, but it follows from two requirements which are
> explicitly stated. First, 'size_t' is required to be able to represent
> the size of any object; when the memory space is flat, this entails
> that 'void*' can be cast to 'size_t' and back without loss of
> information. Second, 'size_t' is required to be no larger than
> 'unsigned long'.
No, just no. It requires that sizeof(void *) can be cast to size_t.
There are plenty of archs where the virtual address space is larger than
any single object can be; lots and lots of old real-mode x86 compilers,
for example. There are explicitly standards-conforming archs where pointer
types can have sizes (a) dependent on the target type of the pointer and (b)
larger than any integer type. For examples of weird pointers:
<andrea at torproject.org>
PGP fingerprint: 3611 95A4 0740 ED1B 7EA5 DF7E 4191 13D9 D0CF BDA5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: not available
More information about the tor-dev