summaryrefslogtreecommitdiff
path: root/gcc/builtin-attrs.def
Commit message (Collapse)AuthorAgeFilesLines
* re PR c++/7099 (G++ doesn't set the noreturn attribute on std::exit and ↵Roger Sayle2002-07-061-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
* builtin-attrs.def: Update copyright years.Jason Thorpe2002-05-231-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
* builtin-attrs.def (__builtin_printf_unlocked, [...]): Mark with the ↵Kaveh R. Ghazi2001-12-211-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
* attribs.c (decl_attributes): Possibly call insert_default_attributes to ↵Joseph Myers2001-10-021-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