🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ian Lance Taylor Tue, 14 Apr 1992 12:22
Spurious warning from gcc-2.1 with -g -Wall but without -O
#400
Author: Ian Lance Taylor
Date: Tue, 14 Apr 1992 12:22
32 lines
1223 bytes
I am using gcc 2.1 configured as decstation-3100.  If the following
program is compiled with -g -Wall but without -O, it gives the
spurious error

    foo.c: In function `f':
    foo.c:25: warning: control reaches end of non-void function

This error does not appear if -O is specified, and it does not appear
if -g is not specified.

int f (int a, int b)
{
  if (a)
    {
      if (b)
	return 0;
      else
	return 1;
    }
  else
    {
      if (b)
	return 2;
      else
	return 3;
    }
}
-- 
Ian Taylor                     ian@airs.com                    uunet!airs!ian
First person to identify this quote wins a free e-mail message:
``Do you make a grievance of weighing so many pounds only, instead of three
  hundred?  Then why fret about living so many years only, instead of more?''
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