Article View: gnu.gcc.bug
Article #304Re: gcc-2.2.2 generates incorrect warning message
From: Thomas E. Shields
Date: Fri, 07 Aug 1992 06:01
Date: Fri, 07 Aug 1992 06:01
26 lines
1127 bytes
1127 bytes
Arne,
>Yes, that is correct, but it's only one of the comparisons. This code:
>
>int map(c)
> unsigned char c;
>{
> c >= 0;
>}
>
>will give the same warning. I can't read the assembly (never
>understood it), but I suspect the actual comparison with 0 will never
>be done. (Regardless of optimization maybe).
>
>I'm afraid warnings on code produced by web->tangle->web2c->c will
>never be very informational or productive.
Ah, now I understand what the warning was about. Since 'c' is of an
unsigned type, it is by definition always '>= 0' - obviously! So,
the warning was proper.
Sorry to bother everyone.
Thanks
Tom Shields
Technical Details
Message-ID:
<897.713196091@oriole>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!stars.reston.unisys.COM!shieldsReferences:
<199208071225.AA21659@lise1.lise.unit.no>Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!stars.reston.unisys.COM!shields From: shields@stars.reston.unisys.COM (Thomas E. Shields) Subject: Re: gcc-2.2.2 generates incorrect warning message Message-ID: <897.713196091@oriole> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet References: <199208071225.AA21659@lise1.lise.unit.no> Distribution: gnu Date: Fri, 7 Aug 1992 06:01:31 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 28