Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 1999 09:47:47 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Eivind Eklund <eivind@FreeBSD.ORG>
Cc:        Mark Murray <mark@grondar.za>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/pci ide_pci.c
Message-ID:  <199901121747.JAA05087@apollo.backplane.com>

next in thread | raw e-mail | index | archive | help
: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 
				    <dillon@backplane.com>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



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