From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 27 13:31:50 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1378016A420 for ; Wed, 27 Jul 2005 13:31:50 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from viefep12-int.chello.at (viefep12-int.chello.at [213.46.255.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13A6E43D53 for ; Wed, 27 Jul 2005 13:31:48 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from wombat.fafoe.narf.at ([213.47.85.26]) by viefep12-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20050727133146.RTLZ1672.viefep12-int.chello.at@wombat.fafoe.narf.at>; Wed, 27 Jul 2005 15:31:46 +0200 Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 84C98A3; Wed, 27 Jul 2005 15:31:35 +0200 (CEST) Date: Wed, 27 Jul 2005 15:31:35 +0200 From: Stefan Farfeleder To: jason henson Message-ID: <20050727133133.GA560@wombat.fafoe.narf.at> Mail-Followup-To: jason henson , hackers@freebsd.org References: <42E6BD5F.7020909@ec.rr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <42E6BD5F.7020909@ec.rr.com> User-Agent: Mutt/1.5.9i Cc: hackers@freebsd.org Subject: Re: using -ftracer stops buildworld at shutdown.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 13:31:50 -0000 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="shutdown.c.diff" 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++) --6TrnltStXW4iwmi0--