intro.abstract p8 says:
The following specify the observable behavior of the program:
- Accesses through volatile glvalues are evaluated strictly according to the rules of the abstract machine.
- Data is delivered to the host environment to be written into files (See also: ISO/IEC 9899:2024, 7.23.3).
- The input and output dynamics of interactive devices shall take place in such a fashion that prompting output is actually delivered before a program waits for input. What constitutes an interactive device is implementation-defined.
In other words, the behaviors not mentioned in this list are not the C++'s observable behaviors. Consider this example:
// "INT 3"
void call_asm_int_3(){
asm("INT $3");
}
int main(){
std::this_thread::sleep_for(std::chrono::minutes(10));
call_asm_int_3();
}
The specification of sleep_for is thread.thread.this p7:
Effects: Blocks the calling thread for the relative timeout ([thread.req.timing]) specified by rel_time.
Synchronization: None.
It doesn't have the actual observable behavior defined in [intro.abstract] p8. In addition, the function call_asm_int_3 has the effect that hitting a breakpoint, whose external effect can be observed by a human; however, it is also not the C++ defined observable behavior.
So, I wonder, can conforming implementations remove or reorder these functions?
asmare, only that an implementation might define it (or not). eel.is/c++draft/dcl.asmasm("INT $3")as hitting a breakpoint; however, it's still not the C++ defined observable behavior.