The problem with ints and longs is not their sizes, but the fact that people use them interchangeably, their sizes being equal coincidentally on 32-bit architectures.


Most of the bugs occur when pointers to these variables are passed as arguments to variadic functions like zend_parse_parameters(), which are not subject to pointer type checking by the compiler.

Sorry but this idea is out of question. The idea was always that PHP is 64 bit capable as soon you run it on a 64 bit machine. Same for 128 bit

Some data structures [like IPv4 addresses, for instance], are 32-bits regardless of the architecture, so some code needs its variable sizes to be defined explicitly. Defining intxx types might be useful in this respect, but it won't fix the problem mentioned before.


>> typedef __int8 zend_int8;
>> typedef __int16 zend_int16;
>> typedef __int32 zend_int32;
>> typedef __int64 zend_int64;
>> typedef unsigned __int8 zend_uint8;
>> typedef unsigned __int16 zend_uint16;
>> typedef unsigned __int32 zend_uint32;
>> typedef unsigned __int64 zend_uint64;

Arent't the __intxx types MSVC-only ?

--
Ard

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to