public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Jeff Law <law@redhat.com>, Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 2/4] enhance overflow and truncation detection in strncpy and strncat (PR 81117)
Date: Mon, 14 Aug 2017 20:44:00 -0000	[thread overview]
Message-ID: <b0d80bf1-a1a6-1dd2-e927-4f1aa34c4c5e@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1708141947160.28812@digraph.polyomino.org.uk>

On 08/14/2017 01:50 PM, Joseph Myers wrote:
> On Mon, 14 Aug 2017, Martin Sebor wrote:
>
>>  /* This header provides a declarative way of describing the attributes
>> -   that are applied to some functions by default.
>> +   that are applied to some built-in functions by default.  Attributes
>> +   that apply to types or variables but not functions need not and
>> +   should not be defined here.
>
> It's not just type and variable attributes that shouldn't be here.  Any
> function attribute that's not used by at least one built-in function
> shouldn't be here either.  Every tree constructed here adds to startup
> costs; they should only be present if actually used.

Okay.  I expanded on that point in the updated comments below.

Martin

2017-08-14  Martin Sebor  <msebor@redhat.com>

     * builtin-attrs.def: Add comments.

Index: gcc/builtin-attrs.def
===================================================================
--- gcc/builtin-attrs.def	(revision 251097)
+++ gcc/builtin-attrs.def	(working copy)
@@ -18,7 +18,10 @@ along with GCC; see the file COPYING3.  If not see
  <http://www.gnu.org/licenses/>.  */

  /* This header provides a declarative way of describing the attributes
-   that are applied to some functions by default.
+   that are applied to some built-in functions by default.  Attributes
+   that are meant to be used by user-defined functions but aren't used
+   by any built-ins, or attributes that apply to types or variables
+   but not to functions need not and should not be defined here.

     Before including this header, you must define the following macros.
     In each case where there is an ENUM, it is an identifier used to
@@ -85,7 +88,9 @@ DEF_LIST_INT_INT (5,0)
  DEF_LIST_INT_INT (5,6)
  #undef DEF_LIST_INT_INT

-/* Construct trees for identifiers.  */
+/* Construct trees for identifiers used in built-in function attributes.
+   The construction contributes to startup costs so only attributes that
+   are used to define built-ins should be defined here.  */
  DEF_ATTR_IDENT (ATTR_ALLOC_SIZE, "alloc_size")
  DEF_ATTR_IDENT (ATTR_COLD, "cold")
  DEF_ATTR_IDENT (ATTR_CONST, "const")

  reply	other threads:[~2017-08-14 20:06 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-08 20:45 [PATCH] " Martin Sebor
2017-07-18  2:51 ` [PING] " Martin Sebor
2017-07-25  3:10   ` [PING #2] " Martin Sebor
2017-07-31 17:29 ` Jeff Law
2017-07-31 19:42   ` Martin Sebor
2017-08-02 16:59     ` Jeff Law
2017-08-06 20:07       ` [PATCH 1/4] " Martin Sebor
2017-08-10  5:02         ` Jeff Law
2017-08-14 19:21           ` Martin Sebor
2017-08-06 20:07       ` [PATCH 2/4] " Martin Sebor
2017-08-10  6:39         ` Jeff Law
2017-08-14 18:04           ` Martin Sebor
2017-08-14 18:29             ` Joseph Myers
2017-08-14 19:26               ` Martin Sebor
2017-08-14 20:41                 ` Joseph Myers
2017-08-14 20:44                   ` Martin Sebor [this message]
2017-08-15  3:03                     ` Joseph Myers
2017-11-10 23:03         ` Marc Glisse
2017-11-11 21:10           ` Martin Sebor
2017-08-06 20:07       ` [PATCH 4/4] " Martin Sebor
2017-08-06 20:07       ` [PATCH] " Martin Sebor
2017-08-09 19:21         ` Jeff Law
2017-08-06 20:07       ` [PATCH 3/4] " Martin Sebor
2017-08-10  7:17         ` Jeff Law
2017-08-10  7:39           ` Richard Biener
2017-08-10 20:21           ` Martin Sebor
2017-08-15  3:06             ` Martin Sebor
2017-08-23 21:11               ` [PING] " Martin Sebor
2017-08-29  5:07                 ` [PING 2] " Martin Sebor
2017-09-19 15:44                   ` [PING 3] " Martin Sebor
2017-09-26  2:27                     ` [PING 4] " Martin Sebor
2017-10-02 22:15             ` Jeff Law
2017-10-21  0:26               ` Martin Sebor
2017-11-04  3:49                 ` Jeff Law
2017-11-10  0:17                   ` Martin Sebor
2017-11-10  0:31                     ` Jeff Law
2017-11-14  9:24         ` [testsuite, committed] Require alloca for c-c++-common/Wstringop-truncation.c Tom de Vries
2017-11-15 15:30         ` [testsuite, committed] Compile strncpy-fix-1.c with -Wno-stringop-truncation Tom de Vries
2017-11-15 15:58           ` Martin Sebor

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=b0d80bf1-a1a6-1dd2-e927-4f1aa34c4c5e@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=law@redhat.com \
    /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).