home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / bug / 2308 < prev    next >
Encoding:
Text File  |  1992-09-10  |  884 b   |  50 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!mib
  3. From: mib@gnu.ai.mit.edu (Michael I Bushnell)
  4. Subject: Bug in GCC 2.2.2
  5. Message-ID: <9209102121.AA06460@geech.gnu.ai.mit.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Thu, 10 Sep 1992 13:21:09 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 37
  12.  
  13. The following source file:
  14.  
  15. void
  16. foo (short a, short b)
  17. {
  18.   void do_1(), do_2();
  19.   
  20.   if ((a | ((int)b << 16)) & 01000)
  21.     do_1 ();
  22.   else
  23.     do_2 ();
  24. }
  25.  
  26.       
  27.  
  28. Generates the following warning (with -Wall):
  29.  
  30. foo.c:6: warning: shift count exceeds width of value shifted
  31.  
  32. Near as I can tell, this is incorrect; the value being shifted is a
  33. thirty-two bit integer.
  34.  
  35. The following source file does not generate the warning:
  36.  
  37. void
  38. foo (short a, short b)
  39. {
  40.   void do_1();
  41.   
  42.   do_1 (a | ((int)b << 16));
  43. }
  44.  
  45.       
  46.  
  47.  
  48.     -mib
  49.  
  50.