Article View: comp.sys.ibm.pc.programmer
Article #900Re: `C' type question...
From: RAMontante
Date: Mon, 09 Jul 1990 21:51
Date: Mon, 09 Jul 1990 21:51
16 lines
1045 bytes
1045 bytes
weisen@eniac.seas.upenn.edu (Neil Weisenfeld) <26854@netnews.upenn.edu> :
| Why does the following segment of code give a conversion between
| integral types warning under MSC6.00?
|
| void strmem(char *mem, char *str, int n)
| {
| if (str && mem)
| while (n--)
| *mem++=(*str)?(*str++):ACTUAL_SPACE;
| }
K&R2 indicates that the conditional operator ( ? : ) expects a logical
expression in the initial position, and logical expressions evaluate to
integers. Try casting the (*str) to (int) type; that might silence it.
Disclaimer: I haven't tried my TC, so I don't know what MSC actually does :-)
Technical Details
Message-ID:
<50258@iuvax.cs.indiana.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!xanth!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!uunet!mailrus!iuvax!bobmonShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!xanth!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!uunet!mailrus!iuvax!bobmon From: bobmon@iuvax.cs.indiana.edu (RAMontante) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: `C' type question... Message-ID: <50258@iuvax.cs.indiana.edu> Date: 9 Jul 90 21:51:46 GMT Distribution: usa Organization: malkaryotic Lines: 16