Liste des Groupes | Revenir à c arch |
scott@slp53.sl.home (Scott Lurndal) writes:--
mitchalsup@aol.com (MitchAlsup1) writes:A problem with using volatile is that volatile doesn't do what
>On Tue, 3 Dec 2024 13:59:18 +0000, jseigh wrote:>
>The compiler is allow to reorder code as long as it knows the>
reordering can't be observed or detected.
With exceptions enabled, this would allow for almost no code
movement at all.
>If there are places>
in the code it doesn't know this can't happen it won't optimize
across it, more or less.
The problem is HOW to TELL the COMPILER that these memory references
are "more special" than normal--when languages give few mechanisms.
C and C++ have the 'volatile' keyword for this purpose.
most people think it does, especially with respect to what
reordering is or is not allowed.
Les messages affichés proviennent d'usenet.