rfc:better_type_names_for_int64
PHP RFC: Better type names for int64 RFC
- Version: 0.9
- Date: 2014-08-22
- Author: Nikita Popov nikic@php.net
- Status: Under Discussion
Introduction
The int64 RFC introduced a number renames for common types, macros and zpp specifiers, which are both unnecessary and confusing. This RFC proposes to revert the bulk of these renames and use a naming scheme that is consistent with our original types and the terminology used by the C community at large.
The most significant naming changes introduced by the int64 RFC are:
zend_int_tandzend_uint_tare the new 64bit-on-64bit-platforms types.IS_LONGis changed toIS_INT,Z_LVALtoZ_IVAL, etc.Z_STRLENis changed toZ_STRSIZEzend_parse_parametersusesiandIinstead oflandL.
These changes are disapproved of for the following reasons:
- These naming changes serve no purpose and will only create additional headaches when porting code to phpng or merging between branches.
- There now exists a
zend_int_ttype (which is a 64bit-on-64bit type) andzend_int(which is a 32bit type). Apart from the_tsuffix the name is the same, but the meaning is totally different. - PHP and the Zend Engine do not use
_tsuffixes for types. This introduces a new type naming convention that is not used anywhere else. (Probably this is done to avoid clashing with the previous point.) - Furthermore all types ending in
_tare reserved by the POSIX standard. - Using the term
intfor an 64bit type goes against the normal expectations of a C programmer (ILP64 systems are rare). The meaning of thezend_int_ttype is much closer to thelongtype.
Instead the following alternative naming is proposed:
- Retain
zend_intandzend_uintas 32bit types (same as 64bit RFC) - Use
zend_longandzend_ulongas the 64bit-on-64bit-platforms type. As such this type stays the same as previously, with the tweak that it will be 64bit on LLP64 platforms as well. - Revert all type/macro/zpp renames, like
IS_INT,Z_IVAL,Z_STRSIZE,i,I, etc. The original names will be used instead.
Patch
As this is just search&replace renaming a patch will be provided once we have reached a descision on naming.
rfc/better_type_names_for_int64.txt · Last modified: by 127.0.0.1