From: Ulrich Eckhardt on
Pete Becker wrote:
> Ulrich Eckhardt wrote:
>>
>> Committing suicide like GCC did was just the expression of it feeling
>> very sad about the given code. Not every compiler is already as numb as
>> MS's probably is when served fertiliser for dinner. ;^)
>>
>
> Umm, let's be clear here: GCC crashed. That's a bug in the compiler.

Let's be even clearer: MSVC compiled it, which is also a bug.

Seriously, I don't think that either compiler accepted the code in any way
as it is, since it just screams incompleteness. Also, notice the smiley on
that last paragraph of mine, it wasn't meant too technical.

Uli

--
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Pete Becker on
Ulrich Eckhardt wrote:
> Pete Becker wrote:
>> Ulrich Eckhardt wrote:
>>> Committing suicide like GCC did was just the expression of it feeling
>>> very sad about the given code. Not every compiler is already as numb as
>>> MS's probably is when served fertiliser for dinner. ;^)
>>>
>> Umm, let's be clear here: GCC crashed. That's a bug in the compiler.
>
> Let's be even clearer: MSVC compiled it, which is also a bug.
>

I suspect that MSVC compiled something different. But that doesn't
matter. When a compiler crashes, it's a bug.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of
"The Standard C++ Library Extensions: a Tutorial and Reference"
(www.petebecker.com/tr1book)

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Georg Kasper on
Pete Becker wrote:

> Ulrich Eckhardt wrote:
>>
>> Committing suicide like GCC did was just the expression of it feeling
>> very sad about the given code. Not every compiler is already as numb as
>> MS's probably is when served fertiliser for dinner. ;^)
>>
>
> Umm, let's be clear here: GCC crashed. That's a bug in the compiler.
>

% g++ --version
g++ (SUSE Linux) 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision
135036]
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%
% g++ illformed-program.cpp
illformed-program.cpp: In function 'int main()':
illformed-program.cpp:12: error: 'NPP' was not declared in this scope
illformed-program.cpp:12: error: 'cout' was not declared in this scope
illformed-program.cpp:12: error: 'endl' was not declared in this scope
%
%

sorry, but i can't see any gcc compiler crash.
How did you make the gcc crash ??
Are you shure you really used the gcc and not a microsoft compiler ???



--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: FE on
sorry .
code is:

#include <iostream>
using namespace std;
class null_t
{
public:
template<typename T>
operator T*(){return 0;}
}NPP;
int main(){
if(*NPP)cout<<"*this"<<endl;
return 0;
}

NULL change to NPP;

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: ThosRTanner on
On Apr 1, 3:05 pm, Georg Kasper <georg.kas...(a)frm2.tum.de> wrote:
> Pete Becker wrote:
> > Ulrich Eckhardt wrote:
>
> >> Committing suicide like GCC did was just the expression of it feeling
> >> very sad about the given code. Not every compiler is already as numb as
> >> MS's probably is when served fertiliser for dinner. ;^)
>
> > Umm, let's be clear here: GCC crashed. That's a bug in the compiler.
>
> % g++ --version
> g++ (SUSE Linux) 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision
> 135036]
> Copyright (C) 2008 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> %
> % g++ illformed-program.cpp
> illformed-program.cpp: In function �int main()�:
> illformed-program.cpp:12: error: �NPP� was not declared in this scope
> illformed-program.cpp:12: error: �cout� was not declared in this scope
> illformed-program.cpp:12: error: �endl� was not declared in this scope
> %
> %
>
> sorry, but i can't see any gcc compiler crash.
> How did you make the gcc crash ??
> Are you shure you really used the gcc and not a microsoft compiler ???
Perhaps he had NULL instead of NPP?

I can see that might cause confusion. IIRC NULL in gcc isn't quite
(void *)0;


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]