diff --git a/source/ub.tex b/source/ub.tex index e67b430d6c..29768fbab4 100644 --- a/source/ub.tex +++ b/source/ub.tex @@ -31,8 +31,8 @@ }; X* make_x() { - // The call to std::malloc can not implicitly create an object of type X - // because X is not an implicit-lifetime class. + // The call to \tcode{std::malloc} can not implicitly create an object of type \tcode{X} + // because \tcode{X} is not an implicit-lifetime class. X* p = (X*)std::malloc(sizeof(struct X)); p->a = 1; // undefined behavior, no set of objects give us defined behavior return p; @@ -289,7 +289,7 @@ \pnum \ubxref{basic.start.main.exit.during.destruction} \\ -If std::exit is called to +If \tcode{std::exit} is called to end a program during the destruction of an object with static or thread storage duration, the program has undefined behavior. @@ -305,7 +305,7 @@ Exiter ex; // int main() {} -// Undefined behavior when destructor of static variable ex is called it will call std::exit +// undefined behavior when destructor of static variable \tcode{ex} is called it will call \tcode{std::exit} \end{codeblock} \end{example} @@ -339,8 +339,8 @@ B b; int main() {} -// Undefined behavior, static objects are destructed in reverse order, in this case a then b and -// finally c. When the destructor of c is call it calls f() which passes through definition of +// undefined behavior, static objects are destructed in reverse order, in this case \tcode{a} then \tcode{b} and +// finally \tcode{c}. When the destructor of \tcode{c} is called, it calls \tcode{f()} which passes through the definition of // previously destroyed block-scope object \end{codeblock} \end{example}