Skip to content
Snippets Groups Projects
  • Kaveh R. Ghazi's avatar
    b4c984fb
    builtin-attrs.def (__builtin_printf_unlocked, [...]): Mark with the __printf__ attribute. · b4c984fb
    Kaveh R. Ghazi authored
    	* 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
    b4c984fb
    History
    builtin-attrs.def (__builtin_printf_unlocked, [...]): Mark with the __printf__ attribute.
    Kaveh R. Ghazi authored
    	* 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