🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #965

Re: Bug in the : ? operator

#965
From: Mike Stump
Date: Tue, 15 Sep 1992 07:45
28 lines
1193 bytes
This problem should not exist in the next release of gcc.

> From: garp@isy.liu.se (Johan Garpendahl)
> Message-Id: <garp.708856796@isy.liu.se>
> Organization: Dept of EE, University of Linkoping
> Date: 18 Jun 92 08:39:56 GMT
> Apparently-To: gnu-g++-bug@sunic.sunet.se
> To: bug-g++@prep.ai.mit.edu

> I have found something that I think is a bug in g++-2.2.2
> The gcc-2.2.2 frontend does not complain.
> Good old 1.40 (gcc & g++) does not complain.

> I have an SS1+ with SunOS 4.1.1.

> main() {
>     const char* str = "String 1";
>     
>     /* This works */     
>     if (str == 0)
> 	str = "String 2";
>     else
> 	str = str;
>     
>     /* This fails */
>     /* assignment between incompatible pointer types */
>     str = (str == 0) ? "String 2" : str;
> }
Technical Details
Message-ID: <9209150745.AA29348@cygnus.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cygnus.com!mrs
From: mrs@cygnus.com (Mike Stump)
Subject: Re:  Bug in the : ? operator
Message-ID: <9209150745.AA29348@cygnus.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 15 Sep 1992 07:45:26 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 29