Article View: comp.std.c++
Article #3162Incompatibility C++ <-> ANSI-C
From: Tilo Koerbs
Date: Tue, 30 Jan 1996 15:45
Date: Tue, 30 Jan 1996 15:45
20 lines
1216 bytes
1216 bytes
Does the operator ?: an itegral promotion on its second and third operand in C++? I cannot find the answer in the ARM. (I think it says: no) Consider this: char x, y; Which type has the following expression: (a ? x : y) In ANSI-C the type is clearly an 'int' (or 'unsigned'). But the type in C++ is 'char'??? Even different compilers have different results! (Borland 3.1: 'char', SPARCompiler 4.0: 'int') [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<4ekpnj$h7q@fsuj01.rz.uni-jena.de>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs) Newsgroups: comp.std.c++ Subject: Incompatibility C++ <-> ANSI-C Date: 30 Jan 1996 15:45:35 GMT Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <4ekpnj$h7q@fsuj01.rz.uni-jena.de> Reply-To: mkt@isun04.inf.uni-jena.de NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Nntp-Posting-Host: isun07.inf.uni-jena.de Content-Length: 410 X-Lines: 16 Originator: clamage@taumet