🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ bug

#153
From: R. Alberto Villarica
Date: Thu, 23 Jul 1992 19:18
18 lines
846 bytes
The following program doesn't compile with g++2.2.2.

~Al

----------------
main() {
    const char* x = "world";
    
    x = (x == 0) ? "hello" : x; 
    printf(x);
}
---------------------
Here's the output:
g++ test.cc <CR>

test.cc: In function `int  main ()':
test.cc:4: assignment between incompatible pointer types
test.cc:5: warning: implicit declaration of function `printf'
Technical Details
Message-ID: <RVILLARI.92Jul23151829@lynx.cat.syr.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!ames!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cat.syr.edu!rvillari

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!ames!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cat.syr.edu!rvillari
From: rvillari@cat.syr.edu (R. Alberto Villarica)
Subject: g++ bug
Message-ID: <RVILLARI.92Jul23151829@lynx.cat.syr.EDU>
Sender: gnulists@ai.mit.edu
Organization: Syracuse University
Distribution: gnu
Date: Thu, 23 Jul 1992 19:18:29 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 21