Re: GCC 6 -Wnonnull is too aggressive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 19, 2016 at 01:44:45PM +0100, Petr Spacek wrote:
> > It's about checking whether "this", in C++, is NULL.  Since any call on a null
> > pointer is undefined behavior, any code relying on such checks is non-standard.
> 
> Ah, okay. I was talking about pure C all the time, so I got confused :-)

It is not really different for C, just that "this" is in C++ implicitly
nonnull.  Otherwise, if you use a nonnull attribute, you make the same
promise, this function will never be called with NULL as some particular
pointer argument (or all pointer arguments).  So, the undefined behavior
happens if you violate that and call a function with an invalid argument.

	Jakub
--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux