Article View: gnu.gcc.bug
Article #1114Bug in GCC 2.2.2
From: Michael I Bushnell
Date: Thu, 10 Sep 1992 13:21
Date: Thu, 10 Sep 1992 13:21
36 lines
931 bytes
931 bytes
The following source file:
void
foo (short a, short b)
{
void do_1(), do_2();
if ((a | ((int)b << 16)) & 01000)
do_1 ();
else
do_2 ();
}
Generates the following warning (with -Wall):
foo.c:6: warning: shift count exceeds width of value shifted
Near as I can tell, this is incorrect; the value being shifted is a
thirty-two bit integer.
The following source file does not generate the warning:
void
foo (short a, short b)
{
void do_1();
do_1 (a | ((int)b << 16));
}
-mib
Technical Details
Message-ID:
<9209102121.AA06460@geech.gnu.ai.mit.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!mibShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!mib From: mib@gnu.ai.mit.edu (Michael I Bushnell) Subject: Bug in GCC 2.2.2 Message-ID: <9209102121.AA06460@geech.gnu.ai.mit.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Thu, 10 Sep 1992 13:21:09 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 37