public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nnk at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/53562] New: Add -Werror= support for -D_FORTIFY_SOURCE / __builtin___memcpy_chk
Date: Sat, 02 Jun 2012 09:48:00 -0000	[thread overview]
Message-ID: <bug-53562-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2012-06-02  9:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-02  9:48 nnk at google dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53562-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).