Ticket #105 (NULL checks)

kjstol parrotcode at gmail.com
Wed Dec 31 16:57:26 UTC 2008


On Wed, Dec 31, 2008 at 5:03 PM, Mark Glines <mark at glines.org> wrote:

> 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.


I think it's a C #define'd macro, not a function, which is not expanded if
you set the right debug #define
(don't know details by heart).

kjs


>  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
> _______________________________________________
> http://lists.parrot.org/mailman/listinfo/parrot-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.parrot.org/pipermail/parrot-dev/attachments/20081231/73946a88/attachment.htm 


More information about the parrot-dev mailing list