From owner-cvs-all Tue Jan 12 09:48:36 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA17592 for cvs-all-outgoing; Tue, 12 Jan 1999 09:48:36 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA17555; Tue, 12 Jan 1999 09:48:21 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.1/8.9.1) id JAA05087; Tue, 12 Jan 1999 09:47:47 -0800 (PST) (envelope-from dillon) Date: Tue, 12 Jan 1999 09:47:47 -0800 (PST) From: Matthew Dillon Message-Id: <199901121747.JAA05087@apollo.backplane.com> To: Eivind Eklund Cc: Mark Murray , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/pci ide_pci.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk :On Tue, Jan 12, 1999 at 03:13:35PM +0200, Mark Murray wrote: :> On a matter of style, what is the canonical method of fixing "foo may be :> clobbered by longjmp" warnings? : :Correct use of volatile. : :Unfortunately, volatile has the same somewhat counter-intuitive syntax :... : :This is the correct way to eliminate the problem. the char* :is the local variable - and that is what we want to protect: : char * volatile data = volatile pointer to a char : :This is a more esoteric example, just to show how it works: : const char * volatile data = char const * volatile data = : volatile pointer to a const char. : :Eivind. Alternatively, as an example of 'volatile char *data' ... then the pointer itself would not be volatile, but the char data it is pointing to would. E.G. if you are pointing into a memory-mapped I/O device. Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message