aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtin-attrs.def
AgeCommit message (Collapse)AuthorFilesLines
2003-08-03builtin-types.def (BT_SSIZE): New primitive type.Roger Sayle1-47/+1
* builtin-types.def (BT_SSIZE): New primitive type. (BT_FN_INT_PTR_CONST_STRING_VALIST_ARG, BT_FN_STRING_CONST_STRING_CONST_STRING_INT, BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR): New function types. * builtins.def (BUILT_IN_DCGETTEXT, BUILT_IN_DGETTEXT, BUILT_IN_FSCANF, BUILT_IN_GETTEXT, BUILT_IN_STRFMON, BUILT_IN_STRFTIME, BUILT_IN_VFPRINTF, BUILT_IN_VFSCANF): New builtins. * builtin-attrs.def: Remove DEF_FN_ATTR construct and the last few functions that define default attributes using it. * c-common.c (c_common_insert_default_attributes): Do nothing. * doc/extend.texi: Document these "new" builtins. From-SVN: r70113
2003-06-30builtin-attrs.def (gcc_diag, [...]): New format attributes.Kaveh R. Ghazi1-0/+3
gcc: * builtin-attrs.def (gcc_diag, gcc_cdiag, gcc_cxxdiag): New format attributes. * c-format.c (enum format_type): Add gcc_diag_format_type, gcc_cdiag_format_type, and gcc_cxxdiag_format_type. (gcc_diag_length_specs, gcc_cdiag_length_specs, gcc_cxxdiag_length_specs, gcc_diag_flag_pairs, gcc_cdiag_flag_pairs, gcc_cxxdiag_flag_pairs, gcc_diag_flag_specs, gcc_cdiag_flag_specs, gcc_cxxdiag_flag_specs, gcc_diag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): New. (format_types_orig): Add new data. (find_char_info_specifier_index, init_dynamic_diag_info): New functions. (handle_format_attribute): Update to handle new format attributes. testsuite: * gcc.dg/format/gcc_diag-1.c: New test. From-SVN: r68689
2003-06-16builtin-attrs.def, [...]: Don't use macros from "symcat.h", instead rely on ↵Kaveh R. Ghazi1-15/+13
ISO C. * builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c, cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't use macros from "symcat.h", instead rely on ISO C. * system.h: Don't include "symcat.h". * configure.in (AC_C_STRINGIZE): Delete. * config.in, configure: Regenerate. From-SVN: r68035
2003-06-02builtin-attrs.def (ATTR_ASM_FPRINTF): New.Kaveh R. Ghazi1-0/+1
* builtin-attrs.def (ATTR_ASM_FPRINTF): New. * c-format.c (enum format_type): Add asm_fprintf_format_type. (NOARGUMENTS, asm_fprintf_length_specs, asm_fprintf_flag_specs, asm_fprintf_flag_pairs, asm_fprintf_char_table): New. (format_types_orig): Renamed from format_types. Add new data. (format_types): Declare as pointer. (handle_format_attribute): Move later in file so we have all necessary declarations. Add section to capture HOST_WIDE_INT. * output.h (ATTRIBUTE_ASM_FPRINTF, __gcc_host_wide_int__): New. (asm_fprintf): Mark with ATTRIBUTE_ASM_FPRINTF. From-SVN: r67319
2003-05-04builtin-attrs.def (ATTR_NOTHROW_NONNULL_1, [...]): Renamed from ↵Kaveh R. Ghazi1-5/+23
ATTR_NONNULL_1, ATTR_NONNULL_2 and ATTR_NONNULL_3. gcc: * builtin-attrs.def (ATTR_NOTHROW_NONNULL_1, ATTR_NOTHROW_NONNULL_2, ATTR_NOTHROW_NONNULL_3): Renamed from ATTR_NONNULL_1, ATTR_NONNULL_2 and ATTR_NONNULL_3. (ATTR_NOTHROW_NONNULL_1_2, ATTR_NOTHROW_NONNULL_1_4, ATTR_CONST_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1, ATTR_PURE_NOTHROW_NONNULL_1_2, ATTR_MALLOC_NOTHROW_NONNULL_1): New. * builtins.def (DEF_EXT_FALLBACK_BUILTIN): Accept ATTRS argument. (BUILT_IN_BZERO, BUILT_IN_BCOPY, BUILT_IN_BCMP): Update comment (BUILT_IN_INDEX, BUILT_IN_RINDEX, BUILT_IN_MEMCPY, BUILT_IN_MEMMOVE, BUILT_IN_MEMCMP, BUILT_IN_MEMSET, BUILT_IN_MEMPCPY, BUILT_IN_STRCAT, BUILT_IN_STRNCAT, BUILT_IN_STPCPY, BUILT_IN_STRCPY, BUILT_IN_STRNCPY, BUILT_IN_STRCMP, BUILT_IN_STRNCMP, BUILT_IN_STRLEN, BUILT_IN_STRSTR, BUILT_IN_STRPBRK, BUILT_IN_STRSPN, BUILT_IN_STRCSPN, BUILT_IN_STRCHR, BUILT_IN_STRRCHR, BUILT_IN_NAN, BUILT_IN_NANF, BUILT_IN_NANL, BUILT_IN_NANS, BUILT_IN_NANSF, BUILT_IN_NANSL, BUILT_IN_PUTS, BUILT_IN_FPUTC, BUILT_IN_FPUTS, BUILT_IN_FWRITE, BUILT_IN_PUTS_UNLOCKED, BUILT_IN_FPUTC_UNLOCKED, BUILT_IN_FPUTS_UNLOCKED, BUILT_IN_FWRITE_UNLOCKED, BUILT_IN_STRDUP): Add "nonnull" attribute. testsuite: * gcc.dg/nonnull-3.c: New test. From-SVN: r66468
2003-03-02re PR c++/9367 (error: nonnull argument with extern "C" snprintf prototype)Roger Sayle1-12/+6
PR c++/9367 * builtin-types.def (DEF_FUNCTION_TYPE_VAR_3): New macro. (BT_FN_INT_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG, BT_FN_INT_STRING_CONST_STRING_VAR, BT_FN_INT_CONST_STRING_CONST_STRING_VAR, BT_FN_INT_STRING_SIZE_CONST_STRING_VAR): New built-in types. * builtin-attrs.def (ATTR_NONNULL_1, ATTR_NONNULL_2, ATTR_NONNULL_3): Also include the nothrow attribute. (sprintf, scanf, sscanf, vprintf, vsprintf, snprintf, vsnprintf, vscanf, vsscanf): Don't define attributes here. * builtins.def (putchar, puts): Make full C89 built-ins. (snprintf, sprintf, scanf, sscanf, vprintf, vscanf, vsscanf, vsnprintf, vsprintf): New built-ins. * c-common.c (c_common_nodes_and_builtins): Handle new macro DEF_FUNCTION_TYPE_VAR_3. * doc/extend.texi: Document these new built-in functions. * java/builtins.c (builtin_type): Handle DEF_FUNCTION_TYPE_VAR_3. (initialize_builtins): Handle DEF_FUNCTION_TYPE_VAR_3. * g++.old-deja/g++.other/builtins10.C: New test for PR 9367. * gcc.dg/format/attr-5.c: Handle new conflicting types warning. From-SVN: r63650
2002-07-06re PR c++/7099 (G++ doesn't set the noreturn attribute on std::exit and ↵Roger Sayle1-16/+19
std::abort) PR c++/7099 * builtin-attrs.def: Define new attribute lists for use in builtins.def. * builtins.def [DEF_BUILTIN]: Modify to take an additional ATTRS argument, an enumerated value defined in builtin-attrs.def that represents the attribute list for the builtins. Modify all builtin functions to pass an appropriate attribute list. Specify "abort", "exit", "_exit" and "_Exit" builtins here with their required noreturn attributes. * tree.h (enum_builtin_function): Ignore the additional parameter to DEF_BUILTIN. * builtins.c (built_in_names): Likewise. * c-common.c: (builtin_function_2): Replace the "int noreturn_p" argument with a tree representing the functions attribute list. Pass this "attrs" argument to builtin_function. No longer handle the noreturn_p processing manually. (built_in_attributes): Move the definitions from builtin-attrs.def before c_common_nodes_and_builtins. (c_common_nodes_and_builtins): Handle the new ATTRS parameter in DEF_BUILTIN, passing it to both builtin_function and the changed builtin_function_2. * doc/extend.texi: Document __builtin_abort, __builtin_exit, __builtin__exit and __builtin__Exit. * java/builtins.c (initialize_builtins): Ignore the additional parameter to DEF_BUILTIN. Handle more C/C++ specific junk in the builtins.def file. From-SVN: r55276
2002-05-23builtin-attrs.def: Update copyright years.Jason Thorpe1-17/+28
* 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. From-SVN: r53801
2001-12-21builtin-attrs.def (__builtin_printf_unlocked, [...]): Mark with the ↵Kaveh R. Ghazi1-0/+5
__printf__ attribute. * builtin-attrs.def (__builtin_printf_unlocked, __builtin_fprintf_unlocked, printf_unlocked, fprintf_unlocked): Mark with the __printf__ attribute. * builtins.c (expand_builtin_fputs): Add an `unlocked' parameter and set the replacement function depending on it. (expand_builtin): Skip BUILT_IN_*_UNLOCKED when not optimizing. Handle BUILT_IN_*_UNLOCKED when optimizing. * builtins.def (DEF_EXT_FALLBACK_BUILTIN, DEF_EXT_FRONT_END_LIB_BUILTIN): New macros. Declare the "unlocked" stdio functions. * c-common.c (c_expand_builtin_printf, c_expand_builtin_fprintf): Add an `unlocked' parameter and set the replacement function depending on it. (c_expand_builtin): Handle BUILT_IN_PRINTF_UNLOCKED and BUILT_IN_FPRINTF_UNLOCKED. * doc/extend.texi (printf_unlocked, fprintf_unlocked, fputs_unlocked): Document. testsuite: * gcc.dg/format/builtin-1.c: Test unlocked stdio. * gcc.dg/format/c90-printf-3.c: Likewise. * gcc.dg/format/c99-printf-3.c: Likewise. * gcc.dg/format/ext-1.c: Likewise. * gcc.dg/format/ext-6.c: Likewise. * gcc.dg/format/format.h: Prototype unlocked stdio. From-SVN: r48229
2001-10-02attribs.c (decl_attributes): Possibly call insert_default_attributes to ↵Joseph Myers1-0/+166
insert default attributes on... * attribs.c (decl_attributes): Possibly call insert_default_attributes to insert default attributes on functions in a lazy manner. * builtin-attrs.def: New file; define the default format and format_arg attributes. * c-common.c (c_format_attribute_table): Move to earlier in the file. (c_common_nodes_and_builtins): Initialize format_attribute_table. (enum built_in_attribute, built_in_attributes, c_attrs_initialized, c_init_attributes, c_common_insert_default_attributes): New. (c_common_lang_init): Don't initialize format_attribute_table. Do call c_init_attributes. * Makefile.in (c-common.o): Depend on builtin-attrs.def. * c-common.h (init_function_format_info): Don't declare. (c_common_insert_default_attributes): Declare. * c-decl.c (implicitly_declare, builtin_function): Call decl_attributes. (init_decl_processing): Don't call init_function_format_info. (insert_default_attributes): New. * c-format.c (handle_format_attribute, handle_format_arg_attribute): Be quiet about inappropriate declaration when applying default attributes. (init_function_format_info): Remove. * tree.h (enum attribute_flags): Add ATTR_FLAG_BUILT_IN. (insert_default_attributes): Declare. cp: * decl.c (init_decl_processing): Don't call init_function_format_info. Initialize lang_attribute_table earlier. (builtin_function): Call decl_attributes. (insert_default_attributes): New. testsuite: * gcc.dg/format/attr-5.c, gcc.dg/format/attr-6.c: New tests. From-SVN: r45942