[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: using -ftracer stops buildworld at shutdown.c
From:       Stefan Farfeleder <stefan () fafoe ! narf ! at>
Date:       2005-07-27 13:31:35
Message-ID: 20050727133133.GA560 () wombat ! fafoe ! narf ! at
[Download RAW message or body]

On Tue, Jul 26, 2005 at 06:46:55PM -0400, jason henson wrote:

> To avoid this warning, the variables and/or arguments should be 
> prevented from being optimized by declaring them as volatile.
> 
> So I sprinkled some volatiles around, but mostly got more errors  that 
> said "gcc volatile discards qualifiers from pointer target type" in the 
> fprintf functions.

Replacing line 276 with 'FILE *volatile pf;' fixes the warning.  But the
usage of {long,set}jmp() is wrong anyway since timeout() can jump back
into timewarn() while that isn't executed at all.

Stefan

["shutdown.c.diff" (text/plain)]

Index: shutdown.c
===================================================================
RCS file: /home/ncvs/src/sbin/shutdown/shutdown.c,v
retrieving revision 1.28
diff -I.svn -u -r1.28 shutdown.c
--- shutdown.c	25 Jan 2005 08:40:51 -0000	1.28
+++ shutdown.c	27 Jul 2005 13:24:29 -0000
@@ -273,7 +273,7 @@
 {
 	static int first;
 	static char hostname[MAXHOSTNAMELEN + 1];
-	FILE *pf;
+	FILE *volatile pf;
 	char wcmd[MAXPATHLEN + 4];
 
 	if (!first++)


_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic