using -ftracer stops buildworld at shutdown.c

Stefan Farfeleder stefan at fafoe.narf.at
Wed Jul 27 13:31:50 GMT 2005


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
-------------- next part --------------
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++)


More information about the freebsd-hackers mailing list