Re: [AD] PATCH: updated mprotect patch for allegro-4.2.1 which also work on Linux

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Normal conventions say that sizeof(long) is the largest integer an arch
> can represent unless sizeof(int) is larger then that in which case
> sizeof(long) == sizeof(int)

The C standard does not mandate that any basic type be natively supported.


> long long is not a C basis type.

Yes. Please see the C standard (ANSI ISO IEC 9899-1999), section 6.2.5.4:

"There are five standard signed integer types, designated as signed char, short int, int, long int, and long long int. (These and other types may be designated in several additional ways, as described in 6.7.2.) There may also be implementation-defined extended signed integer types.28) The standard and extended signed integer types are collectively called signed integer types.29"




Hans de Goede wrote:


Robert Jr Ohannessian wrote:

Hans de Goede wrote:

What the !@#$% MS idiots what were they thinking everyone uses long == 64 bits on 64 bit archs, so hey lets be microsoft lets do it different.


Technically, Microsoft's implementation is full C standard compliant. All you know about 'long' is that:

1) sizeof(long long) >= sizeof(long) >= sizeof(int)
2) LONG_MIN -2147483647 // -(^231 - 1)  (maximum value)
   LONG_MAX +2147483647 // 2^31 - 1     (minimum value)

Any other assumptions you make is at your own risk. C does not even guarentee 2's complement representation.


Normal conventions say that sizeof(long) is the largest integer an arch can represent unless sizeof(int) is larger then that in which case sizeof(long) == sizeof(int)

See the C standard, second 5.2.4.2.1, 6.2.5 and 6.3.1.1.


'long long' is the only C basic type that requires at least 64-bit of storage (but not strictly so).


long long is not a C basis type.

Regards,

Hans


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/