Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++strict aliasing rulesSingle-choice MCQ

Consider this snippet exercising the strict aliasing rule. Assuming a conforming optimizing compiler with no `-fno-strict-aliasing`, what is the standard-sanctioned characterization of the read on the marked line?

int foo(float* f, int* i) { *i = 1; *f = 2.0f; return *i; // <-- this read }