Re:A Guide to Undefined Behavior in C and C++ (2010)
by otabdeveloper2 on Sunday November 04, 2018 @04:25AM
(#18375026)
When people talk of UB in C++ they always mean "implementation specific".
[ Parent
| on HN ]
Re:A Guide to Undefined Behavior in C and C++ (2010)
by saagarjha on Sunday November 04, 2018 @04:44AM
(#18375069)
No, they don’t. These are separate concepts with different behavior. “Undefined behavior” is illegal to have in C/C++ programs and includes things like division by zero and out-of-bounds array access. “Implementation specific” behavior is legal but allowed to differ, such as querying the size of an int.
Re:A Guide to Undefined Behavior in C and C++ (2010)
by esrauch on Sunday November 04, 2018 @07:03AM
(#18375468)
You really don't need to go very far to get into UB instead of implementation defined: signed int overflow is already UB and the program is permitted to do literally anything if you ever accidentally make one of your ints too large.