> If PHP5 cvs is compiled with gcc 3.3 and -Wall, there are
> warnings about: "dereferencing type-punned pointer will break
> strict-aliasing rules". E.g. they occur if the last parameter of
> zend_hash_find is a zval ** and used as
> zend_hash_find(..., (void **) &data).

Casting to void* instead of void** cures the problem. As the cast
is used to 'remove' the type from a variable, and not to change it,
I would consider it a justified change. I don't think there will be
consequences for the validity of the optimization.

> Does anybody who knows gcc or the C standard better than I
> know another solution?

Code will have to be changed regardless, as it's not the function
invocation but the cast itself that triggers the warning.

Ard

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

Reply via email to