[webkit-dev] NeverNull<T>

Adam Barth abarth at webkit.org
Wed Jul 29 00:47:29 PDT 2009


Another approach is to do the opposite: use PossbilyNull<T> for
particular pointers that folks commonly forget to null check.  The
Document pointer in Nodes and the Frame pointer in Documents come to
mind...

Adam


On Wed, Jul 29, 2009 at 12:40 AM, Pierre
d'Herbemont<pdherbemont at gmail.com> wrote:
>
> On Jul 28, 2009, at 3:25 PM, Eric Seidel wrote:
>
> void doSomething(Foo* foo)
> {
>     ASSERT(foo);
> }
>
> As a side note, gcc should support nonnull attribute even for C++. That's a
> way to get some static analysis for free.
>
> void doSomething(Foo* foo) __attribute__((nonnull));
> Pierre.
> [1] http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
>
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>


More information about the webkit-dev mailing list