public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/5377: Warning not given when optimizing
@ 2002-01-14  8:26 booh
  0 siblings, 0 replies; 2+ messages in thread
From: booh @ 2002-01-14  8:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5377
>Category:       optimization
>Synopsis:       Warning not given when optimizing
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 14 08:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     booh@altern.org
>Release:        gcc-3.0.3
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
Here are the results with some versions, note that
only the latest shows the problem.

gcc-2.95.3 -Wreturn-type -O2 -finline-functions :
In function `function':
warning: control reaches end of non-void function

gcc-3.0.3 -Wreturn-type -O2 :
In function `function':
warning: control reaches end of non-void function
/* ./a.out returns 123. */

gcc-3.0.3 -Wreturn-type -O2 -finline-functions
/* No warning. */


So the problem is that in the last compilation
the warning is not given and the function()
returns nothing.
>How-To-Repeat:
static int global_variable;

static int
function (void)
{
  /* Just for function() to do something. */
  global_variable = 123;
}

int
main (void)
{
  return function ();
}
>Fix:
Maybe check_function_return_warnings() should be called before considering making the function inline.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: optimization/5377: Warning not given when optimizing
@ 2002-04-03  2:07 rth
  0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-04-03  2:07 UTC (permalink / raw)
  To: booh, gcc-bugs, gcc-prs, nobody

Synopsis: Warning not given when optimizing

State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Wed Apr  3 02:06:57 2002
State-Changed-Why:
    Fixed for gcc 3.1:
    
    z.c:8: warning: no return statement in function returning non-void

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5377


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-03 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-14  8:26 optimization/5377: Warning not given when optimizing booh
2002-04-03  2:07 rth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).