https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105357
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- You need better error checking in your code. scanf can fail and scanf with %s without a size can definitely have a buffer overflow. You might be able to detect some of this with -fsanitize=address or by using valgrind. This is almost definitely not a bug in GCC.