diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2001-12-21 02:36:37 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2001-12-21 02:36:37 +0000 |
commit | b4c984fbec1caaaa03c2c2bf2c9b42d3f7679223 (patch) | |
tree | 840ebfbffcd09b2abfcb6059dc21b1f965cc1ab5 /gcc/builtin-attrs.def | |
parent | bfa8af3e37f63413295d14f15eae6dda770d4a02 (diff) | |
download | gcc-b4c984fbec1caaaa03c2c2bf2c9b42d3f7679223.zip gcc-b4c984fbec1caaaa03c2c2bf2c9b42d3f7679223.tar.gz gcc-b4c984fbec1caaaa03c2c2bf2c9b42d3f7679223.tar.bz2 |
builtin-attrs.def (__builtin_printf_unlocked, [...]): Mark with the __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
Diffstat (limited to 'gcc/builtin-attrs.def')
-rw-r--r-- | gcc/builtin-attrs.def | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def index de98501..10b3708 100644 --- a/gcc/builtin-attrs.def +++ b/gcc/builtin-attrs.def @@ -125,6 +125,8 @@ DEF_ATTR_TREE_LIST (ATTR_FORMAT_ARG_2, ATTR_FORMAT_ARG, ATTR_LIST_2, ATTR_NULL) -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) @@ -162,5 +164,8 @@ 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 |