This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: patch for builtin unlocked stdio (tester wanted!)
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 28 Nov 2001 11:35:51 +0000 (GMT)
- Subject: Re: RFC: patch for builtin unlocked stdio (tester wanted!)
On Tue, 27 Nov 2001, Kaveh R. Ghazi wrote:
> +/* Extension functions outside the various C standards. */
> +#define DEF_EXTENSION_ATTR(NAME, ATTRS) \
> + DEF_FN_ATTR_IDENT (NAME, ATTRS, (flag_hosted && !flag_no_nonansi_builtin))
> +DEF_EXTENSION_ATTR (printf_unlocked, ATTR_FORMAT_PRINTF_1_2)
> +DEF_EXTENSION_ATTR (fprintf_unlocked, ATTR_FORMAT_PRINTF_2_3)
> +#undef DEF_EXTENSION_ATTR
There is already DEF_EXT_ATTR, used for strfmon (X/Open) and the gettext
functions.
You can test the attributes without needing the system library to support
the functions. See gcc.dg/format/builtin-1.c for existing built-in
function tests; similar tests can be created for the __builtin and the
plain _unlocked functions (the latter should have the prototypes added to
format.h). (Include tests that the plain _unlocked functions do not get
their attributes in strict C90/C99 mode - see e.g. c90-printf-3.c.)
--
Joseph S. Myers
jsm28@cam.ac.uk