← Back to context Comment by ahoka 17 hours ago By definition UB cannot be safe. 3 comments ahoka Reply umanwizard 10 minutes ago Something can be UB according to the standard, but defined (and safe) according to a particular implementation. Lots of stuff is UB according to the C or C++ standard but does something sensible in gcc and/or clang. Maxatar 12 hours ago The definition given by the C standard allows for safe undefined behavior. marssaxman 16 hours ago this depends on your choice of definition for "safe"
umanwizard 10 minutes ago Something can be UB according to the standard, but defined (and safe) according to a particular implementation. Lots of stuff is UB according to the C or C++ standard but does something sensible in gcc and/or clang.
Something can be UB according to the standard, but defined (and safe) according to a particular implementation. Lots of stuff is UB according to the C or C++ standard but does something sensible in gcc and/or clang.
The definition given by the C standard allows for safe undefined behavior.
this depends on your choice of definition for "safe"