[Bug c/106503] "const char []" in local scope never initialized

eb at emlix dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 2 09:08:43 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106503

--- Comment #4 from Rolf Eike Beer <eb at emlix dot com> ---
You are right, but if you switch the if clause a little bit:

        if (argc) {
                const char junk[] = "abc";
                WRITEL(junk + i);
                WRITEL("something else");
        }

and then stop in the debugger on the second WRITEL you can see that junk has
never been initialized at all. So even within that scope it has the wrong
contents.


More information about the Gcc-bugs mailing list