> A check for 2.96 has been committed a while ago. What do you > think about adding the malloc attribute to functions which > either return NULL or an emalloc'ed pointer?
If the return type is char* or void*, adding the malloc attribute would be appropriate. Aliasing isn't an issue for null pointers, because they can't be dereferenced anyway.
> I've also added a few other attributes in a couple of places. > What do you think about the nonnull attribute?
This is merely a compile-time check, which is unnecessary if you don't initialize pointers to NULL if NULL is an inapproriate value. In that case (with -Wuninitialized enabled) GCC will give a warning that the variable is not initialized.
I am not sure how nonnull is used in optimizations, though.
Ard
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php