This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]