Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t#10597
Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t#10597
Conversation
There was a problem hiding this comment.
should be probably deprecated as well
There was a problem hiding this comment.
I understand zend_bool, zend_*inptr_t were definitions from a time when C99 wasn't required; but unsigned char has always been available, everywhere. Therefore I figured this is not a compatibility definition, but .... I don't know. This doesn't make any sense to me, but I suggested deprecating only those I understood.
There was a problem hiding this comment.
Apparently, zend_uchar isn't used as an unsigned char ("char" as in "ASCII character" - the C nomenclature is confusing), but as small unsigned integer. This is confusing. I'd recommend using uint_least8_t everywhere instead, to clearly indicate that this is about small integers and not ASCII characters.
There was a problem hiding this comment.
if used, they should emit a compiler warning, also I would add something like "and will be removed in PHP 9.0"
There was a problem hiding this comment.
I've added ZEND_ATTRIBUTE_DEPRECATED, but there appears to be no way to attach a message to this GCC attribute.
There was a problem hiding this comment.
GCC should warn implicitly when -Wno-deprecated-declarations is not passed
php-src CI should not pass if any GCC warning is produced
There was a problem hiding this comment.
Yes, but I thought you meant that GCC should write "will be removed in 9" in the message. In C++, the deprecated attribute can be annotated with a message that is printed (https://en.cppreference.com/w/cpp/language/attributes/deprecated), but not the proprietary GCC attribute.
Will add the 9.0 comment.
034cb2e to
3544ec4
Compare
These types are standard C99. For compatibility with out-of-tree extensions, keep the typedefs in main/php.h.
3544ec4 to
61e87ca
Compare
|
AppVeyor failure because |
https://stackoverflow.com/questions/4995868/deprecate-typedef |
|
Oh hooray, GCC wants the attribute at the end after the name, and MSVC wants it between |
These types are standard C99. For compatibility with out-of-tree extensions, keep the typedefs in main/php.h.