From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e8d2c0ed82daf4da X-Google-Attributes: gid103376,public From: robert_dewar@my-dejanews.com Subject: Re: Handling Addressing Errors Date: 1999/03/19 Message-ID: <7csogm$4s5$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 456371134 References: <1999Mar3.212443.1898@nosc.mil> <7bm0v3$933$1@nnrp1.dejanews.com> <1999Mar18.005620.19189@nosc.mil> X-Http-Proxy: 1.0 x7.dejanews.com:80 (Squid/1.1.22) for client 166.72.95.142 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Mar 19 05:49:12 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-03-19T00:00:00+00:00 List-Id: In article <1999Mar18.005620.19189@nosc.mil>, claveman@fern.com (Charles H. Sampson) wrote: > > By my reading, even pragma Volatile doesn't help, > because C.6(10) > only says that all reads are performed directly to > memory. It doesn't > say that the read must be performed even if it is known > that the value > is not used. I think it's well beyond the LRM to say > that a read of a > volatile object might have some effect in addition to > obtaining its > value and, therefore, all reads must be performed whether > the value is > needed or not. No, that is just a wrong reading, and it is NOT worth arguing the delicate semantics of the wording, since everyone knows what is intended here. I guess as a low priority task the ARG could worry about defending the RM from Charles' obviously incorrect reading, but changing the language in the RM will not make one tiny little bit of difference in real life. THe whole POINT of volatile is to make sure that every read and write happens from memory. AN optimizer that eliminates a volatile read or write is broken! One important rule in reading the RM is that you must not ignore the unstated very important rule: "No other rule in this manual can be used to derive a silly conclusion." Basically what this means is that if you sit down and try to read the RM in a hostile manner, you may discover cases in which the wording could be improved, but that does not mean these are cases where compilers will do the wrong thing. For example, it is 100% clear in the original Ada 83 RM that subtype x is integer range 1 .. 10; defines a non-static subtype. But of *course* all compilers treated this as a static subtype, since that is the obvious intent. Similarly the obvious intent of volatile is that it means that all reads and writes happen and that they happen to memory (one very important use of volatile is for example mapping to memory mapped I/O devices and everyone knows this). I am not saying all cases are clear cut. But this one is definitely an example of one that is indeed clear cut. In any case, and especially if you do not agree, you should follow the directions in the RM 59 Informal comments on this International Standard may be sent via e-mail to ada-comment@sei.cmu.edu. If appropriate, the Project Editor will initiate a Technical Corrigendum to be issued for the standard. and let the ARG look at it :-) -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own