Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!paradim!jean From: jean@paradim.UUCP (Jean Pierre LeJacq) Newsgroups: comp.lang.c++ Subject: Re: undesired optimiztion (was C++ coding standards) Summary: Use volatile keyword Message-ID: <280@paradim.UUCP> Date: 24 Aug 90 18:55:00 GMT References: <883@zinn.MV.COM> Organization: Paradigm Software, Milford, NH Lines: 9 In article <883@zinn.MV.COM>, mjv@objects.mv.com (Michael J. Vilot) writes: > ... > The Timer object `t' is only active in the inner block. Of course, the > object is apparently never used, so I may get into trouble with those > building aggressively-optimizing compilers. ... C++ uses the keyword volatile to provide a hint to the compiler to avoid aggresive optimization involving an object. Since it is only a hint, I'm not sure how portable a solution this would be.