Bug in egcs 1.1 -fno-rtti + exception = segfault

Valentin Bonnard bonnardv@pratique.fr
Sat Oct 31 15:24:00 GMT 1998


Martin von Loewis wrote:

> BTW, where does it actually say that dereferencing a null pointer is
> undefined behaviour?

Well, it doesn't really.

The behaviour of *p is that it is the lvalue pointed to by p. 
If p is null, there is no such lvalue, and so the behaviour 
of isn't defined. So it's undefined.

It would be clearer if it said that 'if p doesn't refer to 
an object, the behaviour is undefined'.

(Of course except if p refers to a function ;-)

-- 

Valentin Bonnard                mailto:bonnardv@pratique.fr
info about C++/a propos du C++: http://pages.pratique.fr/~bonnardv/



More information about the Gcc-bugs mailing list