C and C++ could have non_nullable pointers, easily
Posted Aug 20, 2009 22:19 UTC (Thu) by
hppnq (subscriber, #14462)
In reply to:
C and C++ could have non_nullable pointers, easily by hummassa
Parent article:
Null pointers, one month later
Well, yeah. For ages GCC has supported the nonnull function attribute, used to specify arguments of a function that should not be NULL so you can catch these at compile time.
The problem, however, is that in non-trivial programs you need to be able to dereference pointers that could be NULL even if they should not be NULL. The compiler may not be able to catch all of these situations for you.
(
Log in to post comments)