Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!ncar!oddjob!gargoyle!att-ih!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.c Subject: Re: volatile Message-ID: <4269@ihlpf.ATT.COM> Date: 5 Apr 88 00:02:19 GMT References: <12578@brl-adm.ARPA> <1988Mar25.172355.348@utzoo.uucp> <588@imagine.PAWL.RPI.EDU> <1988Mar29.004454.2867@utzoo.uucp> <134@wyse.wyse.com> <9176@tut.cis.ohio-state.edu> <4217@ihlpf.ATT.COM> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 19 I've got a question on 'volatile'. In the following code fragment: /*...*/ extern volatile int foo; int bar; int int_function(); /*...*/ bar = foo++ + int_function(); /*...*/ how is foo incremented? Is the value saved when it is read for the addition, the value 1 added to it, and stored back in foo? Is foo just incremented whenever the compiler would normally increment a post-increment non-volatile variable? Is this just an error that a compiler should flag. I've looked in the standard for the answer and I can't find one. -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_