This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/3408: spurious, misplaced warning: 'will never be executed'
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/3408: spurious, misplaced warning: 'will never be executed'
- From: h dot b dot furuseth at usit dot uio dot no
- Date: Mon, 25 Jun 2001 17:11:13 +0200
- Cc: h dot b dot furuseth at usit dot uio dot no
>Number: 3408
>Category: c
>Synopsis: spurious, misplaced warning: 'will never be executed'
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jun 25 08:16:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Hallvard B Furuseth
>Release: 3.0
>Organization:
>Environment:
System: SunOS bombur.uio.no 5.8 Generic_108528-03 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ./configure --quiet --prefix=/usit/bombur/hbf --program-suffix=-3.0
>Description:
`-O3 -Wunreachable-code' gives a spurious `will never be executed'
warning. It is misplaced as well; the warning it refers to
function `c' - at line 6 which ends function `b'.
>How-To-Repeat:
bash$ cat a.c
void a(void);
void b(void)
{
a();
} /* line 6 */
void c(int i)
{
if (i)
b();
}
bash$ ./xgcc -B./ -O3 -Wunreachable-code -S a.c
a.c: In function `c':
a.c:6: warning: will never be executed
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: