2 ms·
"Implementation-defined" creates a requirement on implementors to document a definition on physical paper. An implementer, though, may write down, "The behavio
by ncmncm 7y ago
"Implementation-defined" creates a requirement on implementors to document a definition on physical paper.
An implementer, though, may write down, "The behavior of this construct is undefined", and they have discharged that responsibility.
Undefined really does mean not defined -- but, not defined in the Standard. Anybody is free to define anything the Standard doesn't, and a program may rely on that. #include <unistd.h> is UB, but your compiler uses the definition provided by the (rather, a) separate Posix Standard.
Implementations do take advantage of explicit UB for optimization opportunities, but that is not its purpose.