public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53562] New: Add -Werror= support for -D_FORTIFY_SOURCE / __builtin___memcpy_chk
@ 2012-06-02  9:48 nnk at google dot com
  2012-06-02 10:25 ` [Bug c/53562] " manu at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nnk at google dot com @ 2012-06-02  9:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53562

             Bug #: 53562
           Summary: Add -Werror= support for -D_FORTIFY_SOURCE /
                    __builtin___memcpy_chk
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nnk@google.com


When compiling with -D_FORTIFY_SOURCE=1, its possible for gcc to detect, at
compile time, certain buffer overflows. This behavior is documented on the gcc
online documentation at
http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html

Currently, the only way to turn these compile warnings into errors is to enable
-Werror. Unfortunately, -Werror turns EVERY warning into an error, catching
unrelated warnings.

Can you please add a -Werror= option to error out on compile time buffer
overflow problems? Perhaps -Werror=array-bounds could be reused for this?

These error messages are generated in gcc/builtins.c (expand_builtin_memory_chk
is one such function).


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-28 22:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-02  9:48 [Bug c/53562] New: Add -Werror= support for -D_FORTIFY_SOURCE / __builtin___memcpy_chk nnk at google dot com
2012-06-02 10:25 ` [Bug c/53562] " manu at gcc dot gnu.org
2014-08-21  0:09 ` manu at gcc dot gnu.org
2022-11-28 22:16 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).