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: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,211e8255c3cfc45d,start X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public From: fjh@cs.mu.oz.au (Fergus Henderson) Subject: Re: Bug story Date: 1998/07/25 Message-ID: <6pcati$8l7$1@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 374768257 References: <35AE4621.2EBC7F6A@eiffel.com> <7hAr1.3249$9E2.2188373@news.teleport.com> <35AF70B9.61C5BF88@oma.com> <35B32BDC.5C2C@dmu.ac.uk> <35B47EAD.3AA9@dmu.ac.uk> <35B60AC4.D703E836@hso.link.com> Organization: Computer Science, The University of Melbourne Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-07-25T00:00:00+00:00 List-Id: "Samuel T. Harris" writes: >Dave Sparks wrote: >> >> Let me try to summarise the argument to date: it was asserted that >> a code fragment like { A + 1; } (where the value of the expression >> is discarded) can be optimised out because the code has no effect; And indeed this is true, unless `A' was declared `volatile'. (I presume by the syntax you are talking about C and/or C++.) >A similar problem involves programming EGA cards. And again, the solution is similar -- declare the video memory `volatile'. >Personally, >this was a common problem for me in the 80's as Ada compilers >on PC's got better and better. The solution in Ada is basically the same as in C/C++, with slightly different syntax: `pragma Volatile' rather than `volatile'. Well, that's true in Ada 95, at least. I don't know off-hand whether `pragma Volatile' was present in Ada 83. Perhaps someone from comp.lang.ada can tell us. -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.