Article View: comp.sys.ibm.pc.programmer
Article #922Re: `C' type question...
From: Stephen Clamage
Date: Tue, 10 Jul 1990 16:30
Date: Tue, 10 Jul 1990 16:30
17 lines
1018 bytes
1018 bytes
weisen@eniac.seas.upenn.edu (Neil Weisenfeld) writes:
>Maybe I should read K&R a little more thoroughly before posting this, but...
Yes.
>Why does the following segment of code give a conversion between
>integral types warning under MSC6.00?
>#define ACTUAL_SPACE ' '
> *mem++=(*str)?(*str++):ACTUAL_SPACE;
The type of a character constant (' ' in your example) is int, not char.
Hence the left side of the colon is type char and the right side is int.
The compiler is correct in issuing the warning.
--
Steve Clamage, TauMetric Corp, steve@taumet.com
Technical Details
Message-ID:
<309@taumet.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!taumet!steveReferences:
<26854@netnews.upenn.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: `C' type question... Message-ID: <309@taumet.com> Date: 10 Jul 90 16:30:20 GMT References: <26854@netnews.upenn.edu> Distribution: usa Organization: Taumetric Corporation, San Diego Lines: 17