This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/3408: spurious, misplaced warning: 'will never be executed'



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]