NotNull pointers

Iain Buclaw ibuclaw at ubuntu.com
Wed Aug 31 13:16:33 PDT 2011


== Quote from Walter Bright (newshound2 at digitalmars.com)'s article
> On 8/31/2011 7:14 AM, Sean Kelly wrote:
> > It's worth mentioning that for some reason, Solaris doesn't protect the
> > entire first page of memory--only the zero address. For accesses the where
> > the compiler pre-computes the offset and reads that location directly, you
> > won't get a segfault if the pointer is null (at least with GCC--haven't
> > tested with Sun's compiler). This makes no sense to me and it's been the
> > source of a ton of problems in C apps I've found. I'm just mentioning this
> > because it's made me leery of relying on the hardware to flag null accesses.
> Solaris is dead anyway :-)

Long live openIndiana! :)


More information about the Digitalmars-d mailing list