🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Michael I Bushnell Thu, 10 Sep 1992 13:21
Bug in GCC 2.2.2
#1114
Author: Michael I Bushnell
Date: Thu, 10 Sep 1992 13:21
36 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads