Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2005 15:31:35 +0200
From:      Stefan Farfeleder <stefan@fafoe.narf.at>
To:        jason henson <jason@ec.rr.com>
Cc:        hackers@freebsd.org
Subject:   Re: using -ftracer stops buildworld at shutdown.c
Message-ID:  <20050727133133.GA560@wombat.fafoe.narf.at>
In-Reply-To: <42E6BD5F.7020909@ec.rr.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
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

[-- Attachment #2 --]
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++)
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050727133133.GA560>