A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/algorithm/../algorithm/../../cpp/../c/language/as_if.html below:

As-if rule - cppreference.com

Allows any and all code transformations that do not change the observable behavior of the program.

[edit] Explanation

The C compiler is permitted to perform any changes to the program as long as the following remains true:

1)

At every

sequence point

, the values of all

volatile

objects are stable (previous evaluations are complete, new evaluations not started).

(until C11) 1)

Accesses (reads and writes) to

volatile

objects occur strictly according to the semantics of the expressions in which they occur. In particular, they are

not reordered

with respect to other volatile accesses on the same thread.

(since C11)

2) At program termination, data written to files is exactly as if the program was executed as written.

3) Prompting text which is sent to interactive devices will be shown before the program waits for input.

4)

If the pragma

#pragma STDC FENV_ACCESS

is supported and is set to

ON

, the changes to the

floating-point environment

(floating-point exceptions and rounding modes) are guaranteed to be observed by the floating-point arithmetic operators and function calls as if executed as written, except that

(since C99) [edit] Notes [edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4