Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c Subject: Re: Default values in #define Date: Sat, 27 Aug 2016 10:25:02 +1200 Lines: 19 Message-ID: References: <1d377167-a33a-402e-89ee-d3efa06d95ab@googlegroups.com> <87twebuwwn.fsf@gmail.com> <36a5bcc3-9e30-468c-a3e1-4b9c9788d395@googlegroups.com> <1Kgvz.279$6d.174@fx26.iad> <8277ffd2-121d-4f3a-9bb0-ad3068696415@googlegroups.com> <502669cd-f0fc-4b99-8c8a-0d806c8b5f20@googlegroups.com> <11e2bb75-ee3c-4904-b7c8-77023426fb45@googlegroups.com> <87vaynj0l9.fsf@bsb.me.uk> <4c14769d-f75d-4c8f-89f6-5290f6b97b32@googlegroups.com> <87poovitqy.fsf@bsb.me.uk> <62672946-dc1f-4d94-9c33-5434f51da85d@googlegroups.com> <71637eed-ce54-4950-9568-d053ff0abc84@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net hToQ2mk1MDlakwzRgNNWSwsHUguUjuIpD0XR/s6T5f8MMexebn Cancel-Lock: sha1:a4gfNk+TrDfwsVAsmPGNLjSTyTY= User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: <71637eed-ce54-4950-9568-d053ff0abc84@googlegroups.com> Xref: csiph.com comp.lang.c:92767 On 08/27/16 10:05 AM, supercat@casperkitty.com wrote: > On Friday, August 26, 2016 at 4:37:23 PM UTC-5, Richard Damon wrote: >> volatile only requires that the compiler reads the variable exactly once >> for every read mention and writes exactly once for every assignment in >> the code. They also need to be ordered based on the promises of the >> abstract machine. It does not guarantee atomic access. For that you need >> to use things with atomic guarantees. > > It is often reasonable for an implementation to limit its guarantees to > those the hardware would provide on a "normal" access. That does not > imply that programmers should not be entitled to expect that *quality* > implementations will provide guarantees at least as strong as those of > the underlying hardware unless there is an obviously-compelling reason > to do so. It would still be foolhardy to rely on such an assumption. -- Ian