diff options
author | kan <kan@FreeBSD.org> | 2003-07-11 03:40:53 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2003-07-11 03:40:53 +0000 |
commit | b2a8872fbe1ec1c49094559ac7b78e6ea4ab7180 (patch) | |
tree | f6b0610f4a17fd26aa234354f050080f789861a4 /contrib/gcc/builtin-attrs.def | |
parent | 52e69d78eee5612ac195e0701a5cebe40d1ab0e1 (diff) | |
download | FreeBSD-src-b2a8872fbe1ec1c49094559ac7b78e6ea4ab7180.zip FreeBSD-src-b2a8872fbe1ec1c49094559ac7b78e6ea4ab7180.tar.gz |
Gcc 3.3.1-pre as of 2003-07-11.
Diffstat (limited to 'contrib/gcc/builtin-attrs.def')
-rw-r--r-- | contrib/gcc/builtin-attrs.def | 90 |
1 files changed, 49 insertions, 41 deletions
diff --git a/contrib/gcc/builtin-attrs.def b/contrib/gcc/builtin-attrs.def index 10b3708..7bdbd62 100644 --- a/contrib/gcc/builtin-attrs.def +++ b/contrib/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. @@ -77,36 +77,65 @@ DEF_LIST_INT_INT (3,0) DEF_LIST_INT_INT (3,4) #undef DEF_LIST_INT_INT +/* Construct tress for identifiers. */ +DEF_ATTR_IDENT (ATTR_CONST, "const") +DEF_ATTR_IDENT (ATTR_FORMAT, "format") +DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg") +DEF_ATTR_IDENT (ATTR_MALLOC, "malloc") +DEF_ATTR_IDENT (ATTR_NONNULL, "nonnull") +DEF_ATTR_IDENT (ATTR_NORETURN, "noreturn") +DEF_ATTR_IDENT (ATTR_NOTHROW, "nothrow") DEF_ATTR_IDENT (ATTR_PRINTF, "printf") +DEF_ATTR_IDENT (ATTR_PURE, "pure") DEF_ATTR_IDENT (ATTR_SCANF, "scanf") -DEF_ATTR_IDENT (ATTR_STRFTIME, "strftime") DEF_ATTR_IDENT (ATTR_STRFMON, "strfmon") +DEF_ATTR_IDENT (ATTR_STRFTIME, "strftime") -DEF_ATTR_IDENT (ATTR_FORMAT, "format") -DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg") +DEF_ATTR_TREE_LIST (ATTR_NOTHROW_LIST, ATTR_NOTHROW, ATTR_NULL, ATTR_NULL) + +DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_LIST, ATTR_CONST, \ + ATTR_NULL, ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LIST, ATTR_PURE, \ + ATTR_NULL, ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LIST, ATTR_NORETURN, \ + ATTR_NULL, ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_LIST, ATTR_MALLOC, \ + ATTR_NULL, ATTR_NOTHROW_LIST) + +DEF_ATTR_TREE_LIST (ATTR_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, \ + ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, \ + ATTR_NOTHROW_LIST) +DEF_ATTR_TREE_LIST (ATTR_NONNULL_3, ATTR_NONNULL, ATTR_LIST_3, \ + ATTR_NOTHROW_LIST) /* 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) \ @@ -121,24 +150,10 @@ DEF_ATTR_TREE_LIST (ATTR_FORMAT_ARG_2, ATTR_FORMAT_ARG, ATTR_LIST_2, ATTR_NULL) -ffreestanding, these default attributes are disabled, and must be specified manually if desired. */ -/* __builtin functions should be checked unconditionally, even with - -ffreestanding. */ -DEF_FN_ATTR_IDENT (__builtin_printf, ATTR_FORMAT_PRINTF_1_2, true) -DEF_FN_ATTR_IDENT (__builtin_fprintf, ATTR_FORMAT_PRINTF_2_3, true) -DEF_FN_ATTR_IDENT (__builtin_printf_unlocked, ATTR_FORMAT_PRINTF_1_2, true) -DEF_FN_ATTR_IDENT (__builtin_fprintf_unlocked, ATTR_FORMAT_PRINTF_2_3, true) - /* Functions from ISO/IEC 9899:1990. */ #define DEF_C89_ATTR(NAME, ATTRS) DEF_FN_ATTR_IDENT (NAME, ATTRS, flag_hosted) -DEF_C89_ATTR (printf, ATTR_FORMAT_PRINTF_1_2) -DEF_C89_ATTR (fprintf, ATTR_FORMAT_PRINTF_2_3) -DEF_C89_ATTR (sprintf, ATTR_FORMAT_PRINTF_2_3) -DEF_C89_ATTR (scanf, ATTR_FORMAT_SCANF_1_2) DEF_C89_ATTR (fscanf, ATTR_FORMAT_SCANF_2_3) -DEF_C89_ATTR (sscanf, ATTR_FORMAT_SCANF_2_3) -DEF_C89_ATTR (vprintf, ATTR_FORMAT_PRINTF_1_0) DEF_C89_ATTR (vfprintf, ATTR_FORMAT_PRINTF_2_0) -DEF_C89_ATTR (vsprintf, ATTR_FORMAT_PRINTF_2_0) DEF_C89_ATTR (strftime, ATTR_FORMAT_STRFTIME_3_0) #undef DEF_C89_ATTR @@ -147,11 +162,7 @@ DEF_C89_ATTR (strftime, ATTR_FORMAT_STRFTIME_3_0) DEF_FN_ATTR_IDENT (NAME, ATTRS, \ (flag_hosted \ && (flag_isoc99 || flag_noniso_default_format_attributes))) -DEF_C99_ATTR (snprintf, ATTR_FORMAT_PRINTF_3_4) -DEF_C99_ATTR (vsnprintf, ATTR_FORMAT_PRINTF_3_0) -DEF_C99_ATTR (vscanf, ATTR_FORMAT_SCANF_1_0) DEF_C99_ATTR (vfscanf, ATTR_FORMAT_SCANF_2_0) -DEF_C99_ATTR (vsscanf, ATTR_FORMAT_SCANF_2_0) #undef DEF_C99_ATTR /* Functions not in any version of ISO C. */ @@ -164,8 +175,5 @@ DEF_EXT_ATTR (dgettext, ATTR_FORMAT_ARG_2) DEF_EXT_ATTR (dcgettext, ATTR_FORMAT_ARG_2) /* X/Open strfmon function. */ DEF_EXT_ATTR (strfmon, ATTR_FORMAT_STRFMON_3_4) -/* Glibc thread-unsafe stdio functions. */ -DEF_EXT_ATTR (printf_unlocked, ATTR_FORMAT_PRINTF_1_2) -DEF_EXT_ATTR (fprintf_unlocked, ATTR_FORMAT_PRINTF_2_3) #undef DEF_EXT_ATTR #undef DEF_FN_ATTR_IDENT |