diff options
author | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-23 18:32:12 +0000 |
---|---|---|
committer | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-23 18:32:12 +0000 |
commit | 314bd4cf6a6176d326128efbe4b829073305b81e (patch) | |
tree | a0f4ef4e49cca963a0f7c4212cd7cef8b803fee1 /gcc/builtin-attrs.def | |
parent | 0ba0ef708bc3205de3e1b15d6561694b3d23f4cf (diff) | |
download | gcc-314bd4cf6a6176d326128efbe4b829073305b81e.tar.gz |
* builtin-attrs.def: Update copyright years.
(ATTR_NONNULL): New attribute identifier.
(ATTR_NONNULL_1, ATTR_NONNULL_2, ATTR_NONNULL_3): New
attribute tree lists.
(DEF_FORMAT_ATTRIBUTE): Chain a nonnull attribute for the
format operand.
(ATTR_FORMAT_ARG_1, ATTR_FORMAT_ARG_2): Use...
(DEF_FORMAT_ARG_ATTRIBUTE): ...this to generate format_arg
attribute lists. Chain the appropriate nonnull attribute.
* c-format.c (check_format_arg): Remove null format string
warning.
* testsuite/gcc.dg/format/null-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53801 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtin-attrs.def')
-rw-r--r-- | gcc/builtin-attrs.def | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def index 10b370893e2..56081d1cc51 100644 --- a/gcc/builtin-attrs.def +++ b/gcc/builtin-attrs.def @@ -1,4 +1,4 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002 Free Software Foundation, Inc. Contributed by Joseph Myers <jsm28@cam.ac.uk>. This file is part of GCC. @@ -85,28 +85,39 @@ DEF_ATTR_IDENT (ATTR_STRFMON, "strfmon") DEF_ATTR_IDENT (ATTR_FORMAT, "format") DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg") +DEF_ATTR_IDENT (ATTR_NONNULL, "nonnull") + +DEF_ATTR_TREE_LIST (ATTR_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, ATTR_NULL) +DEF_ATTR_TREE_LIST (ATTR_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, ATTR_NULL) +DEF_ATTR_TREE_LIST (ATTR_NONNULL_3, ATTR_NONNULL, ATTR_LIST_3, ATTR_NULL) + /* Construct a tree for a format attribute. */ -#define DEF_FORMAT_ATTRIBUTE(TYPE, VALUES) \ +#define DEF_FORMAT_ATTRIBUTE(TYPE, FA, VALUES) \ DEF_ATTR_TREE_LIST (CONCAT4 (ATTR_,TYPE,_,VALUES), ATTR_NULL, \ CONCAT2 (ATTR_,TYPE), CONCAT2 (ATTR_LIST_,VALUES)) \ DEF_ATTR_TREE_LIST (CONCAT4 (ATTR_FORMAT_,TYPE,_,VALUES), ATTR_FORMAT, \ - CONCAT4 (ATTR_,TYPE,_,VALUES), ATTR_NULL) -DEF_FORMAT_ATTRIBUTE(PRINTF,1_0) -DEF_FORMAT_ATTRIBUTE(PRINTF,1_2) -DEF_FORMAT_ATTRIBUTE(PRINTF,2_0) -DEF_FORMAT_ATTRIBUTE(PRINTF,2_3) -DEF_FORMAT_ATTRIBUTE(PRINTF,3_0) -DEF_FORMAT_ATTRIBUTE(PRINTF,3_4) -DEF_FORMAT_ATTRIBUTE(SCANF,1_0) -DEF_FORMAT_ATTRIBUTE(SCANF,1_2) -DEF_FORMAT_ATTRIBUTE(SCANF,2_0) -DEF_FORMAT_ATTRIBUTE(SCANF,2_3) -DEF_FORMAT_ATTRIBUTE(STRFTIME,3_0) -DEF_FORMAT_ATTRIBUTE(STRFMON,3_4) + CONCAT4 (ATTR_,TYPE,_,VALUES), CONCAT2 (ATTR_NONNULL_,FA)) +DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_0) +DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_2) +DEF_FORMAT_ATTRIBUTE(PRINTF,2,2_0) +DEF_FORMAT_ATTRIBUTE(PRINTF,2,2_3) +DEF_FORMAT_ATTRIBUTE(PRINTF,3,3_0) +DEF_FORMAT_ATTRIBUTE(PRINTF,3,3_4) +DEF_FORMAT_ATTRIBUTE(SCANF,1,1_0) +DEF_FORMAT_ATTRIBUTE(SCANF,1,1_2) +DEF_FORMAT_ATTRIBUTE(SCANF,2,2_0) +DEF_FORMAT_ATTRIBUTE(SCANF,2,2_3) +DEF_FORMAT_ATTRIBUTE(STRFTIME,3,3_0) +DEF_FORMAT_ATTRIBUTE(STRFMON,3,3_4) #undef DEF_FORMAT_ATTRIBUTE -DEF_ATTR_TREE_LIST (ATTR_FORMAT_ARG_1, ATTR_FORMAT_ARG, ATTR_LIST_1, ATTR_NULL) -DEF_ATTR_TREE_LIST (ATTR_FORMAT_ARG_2, ATTR_FORMAT_ARG, ATTR_LIST_2, ATTR_NULL) +/* Construct a tree for a format_arg attribute. */ +#define DEF_FORMAT_ARG_ATTRIBUTE(FA) \ + DEF_ATTR_TREE_LIST (CONCAT2 (ATTR_FORMAT_ARG_,FA), ATTR_FORMAT_ARG, \ + CONCAT2 (ATTR_LIST_,FA), CONCAT2 (ATTR_NONNULL_,FA)) +DEF_FORMAT_ARG_ATTRIBUTE(1) +DEF_FORMAT_ARG_ATTRIBUTE(2) +#undef DEF_FORMAT_ARG_ATTRIBUTE /* Define an attribute for a function, along with the IDENTIFIER_NODE. */ #define DEF_FN_ATTR_IDENT(NAME, ATTRS, PREDICATE) \ |