public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: am-99173@konami.com
To: gcc-gnats@gcc.gnu.org
Subject: optimization/7189: gcc -O2 -Wall does not print ``control reaches end of non-void function'' warning
Date: Tue, 02 Jul 2002 21:06:00 -0000	[thread overview]
Message-ID: <20020703035834.18750.qmail@sources.redhat.com> (raw)


>Number:         7189
>Category:       optimization
>Synopsis:       gcc -O2 -Wall does not print ``control reaches end of non-void function'' warning
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 02 21:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Honda Hiroki
>Release:        gcc version 3.1
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
[gcc -O -Wall] reasonably prints a warning message complaining ``control reaches end of non-void function''.  [gcc -O2 -Wall] should also print the same warning message.  However, [gcc -O2 -Wall] silently succeeds.

cd /tmp
tar xfz gcc-3.1.tar.gz
mkdir /tmp/build
mkdir /tmp/experiment
cd /tmp/build
../gcc-3.1/configure \
    --prefix=/tmp/experiment \
    --enable-languages=c
make bootstrap
make install
cd /tmp
echo "extern void foo(void);" > chk.c
echo "int bar(void) { foo(); }" >> chk.c
/tmp/experiment/bin/gcc -S -O -Wall chk.c
  --> "warning: control reaches end of ..."
      (correct behavior)
/tmp/experiment/bin/gcc -S -O2 -Wall chk.c
  --> compilation silently succeeds
      (wrong behavior)


>How-To-Repeat:
extern void foo(void);
int bar(void) { foo(); }

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-07-03  4:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-02 21:06 am-99173 [this message]
2003-02-13 15:36 Steven Bosscher
2003-02-13 21:06 Steven Bosscher
2003-03-01  0:36 Richard Henderson
2003-03-01  0:36 Richard Henderson
2003-03-01 22:56 Steven Bosscher
2003-03-02 21:06 Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020703035834.18750.qmail@sources.redhat.com \
    --to=am-99173@konami.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).