This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help on gcc



> For those that believe in "Free Software": read carefully the e-mails 
> exchanged between me and Mr. Oliva, who answers by GCC (a free C++ 
> Compiler)...

Alexandre told a bit of a joke to try to explain the concept of "undefined
behavior" to you.  Sorry that you didn't like the joke and took offense,
but you come off looking much worse than he does in the exchange.  Yes, we
all know (well, almost all of us) that the suggestions were whimsical and
not realistic possibilities.

In any case, the short answer is that you cannot count on getting an
exception if you dereference a null pointer.  Since deferencing a
null pointer is undefined behavior, it's legal for the C++ implementation
to throw an exception in this case, but no professional C++ programmer
should rely on such a safety net, since it is not promised by the language
standard.

> For your information, although I think you already know, it works on 
> Microsoft C++ Compiler, and many others C++ Compilers.

It's not correct to assume that this works on many C++ compilers.  It
certainly does not work with Sun's or HP's compilers, or KAI's compiler,
or many others I could name.  Even Microsoft's trick to get an exception
in this case is limited; it won't protect you from other common types of
pointer errors.

> And I don't see any relation between my sister and C++. I guess if someone 
> at Microsoft gave me an awful answer like you, what would happen to him. 
> Probably, he would be fired. That's what you deserve.

You have severely overreacted, and in my opinion, it is you who owe
Alexandre an apology, not the other way around.  You do not have a
supplier/customer relationship with him and are not entitled to be
treated like a customer.  This is the compiler developers' list, not
a user support list, so coming on it and insulting developers is not
acceptable behavior.

But Alexandre: let's lay off joking about people's sisters, OK? :-)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]