https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91951
--- Comment #1 from Allison Karlitskaya <allison.karlitskaya at redhat dot com> --- Two notes: First: Owen Taylor (the author of the blog post) pointed out that with -O2, GCC is able to notice the uninitialised use of the variable in my example and warn about it. Note that this is a general warning about uninitialised use of a value which seems to be a result of inlining of the cleanup function. Indeed, moving the cleanup function to a different compilation unit prevents the warning from being emitted. Second: I realised that my proposal about "just use the initialiser anyway" is unworkable because the initialiser might be a non-constant expression (and produce side-effects). Bug 91952 is something like my best suggestion about a way forward here.