[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [certi-dev] IEEE1516 RIambassador Checking if (&Object == NULL)
From: |
Eric Noulard |
Subject: |
Re: [certi-dev] IEEE1516 RIambassador Checking if (&Object == NULL) |
Date: |
Fri, 12 Nov 2010 13:19:25 +0100 |
2010/11/12 Ijperen, Jeroen van <address@hidden>:
> Hello Eric,
>
> The following piece of code compiles without any warnings in VS 2008 (with
> /W4).
> Yes, it is very evil to do so, however the compiler doesn't even make mention
> of the direct dereference of the NULL pointer.
>
> I do hope that GCC does a better job of catching this error.
Nope it doesn't even with "-Wall -Wextra"
> I agree that it is the responsibility of the developer to make sure he
> doesn't pass a NULL pointer, but in our application we did not have a need
> for tags, so we always used NULL for them.
OK I can see the use case.
> Anyway, I agree that checks like should not be required, as it's the
> developer doing something nasty (even if the compiler doesn't warn him about
> how nasty it really is)
Thank you for the example code.
--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org