This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/30581] Deeply inlined static functions break stack creation



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]