home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: 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
-
- 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
-
-