[Bug c/30581] Deeply inlined static functions break stack creation
sqrammi at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jan 25 17:45:00 GMT 2007
------- Comment #8 from sqrammi at hotmail dot com 2007-01-25 17:45 -------
It would be easy to add support to the compiler to at least warn about char
arrays of non-CPU-word-size length being placed on the stack, right? It
wouldn't even have to be a warning that shows up unless -Wall (or it's own new
-W flag) is specified. Either that, or there needs to be a flag that aligns
each of the inlined functions' stacks on a CPU-word-size boundary that is
turned on by default.
I would strongly recommend a new warning flag like this so that the poop hits
the fan a little earlier than runtime. There are many projects whose
maintainers won't realize this problem in their code unless the compiler warns
them. The better GCC gets at optimizing and inlining functions, the more
likely this is to happen since developers currently don't think twice about
doing a:
char ssid[MAX_SSID_LEN+1];
etc.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30581
More information about the Gcc-bugs
mailing list