Ticket #105 (NULL checks)
Mark Glines
mark at glines.org
Wed Dec 31 16:03:31 UTC 2008
Andy Dougherty wrote:
> One trap: If the gcc attribute_nonnull is still used for these same
> functions, gcc can optimize away the NULL checks, rendering them useless.
> I'd recommend also getting rid of the attribute_nonnull gcc checking. I
> have posted about this at length in previous RT tickets, if you need more
> background.
Ok, I've gone and read through RT #49316 and RT #50684. It sounds an
awful lot like attribute_nonnull is an optimization, not a constraint as
I had originally thought. Therefore it's working against us, not with us.
I'm pretty sure assert() is a C library function. Is gcc really smart
enough (does it make assumptions about the behavior of this library
function) to optimise it out? If so, once we have good coverage through
assert()s, we might consider removing attribute_nonnull entirely, at
least for development builds. The optimization would be nice to have,
but correctness takes priority.
Thanks!
Mark
More information about the parrot-dev
mailing list