From aecd9827c61cb5bc2c1f3dab784066c0d010d1d7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 18 Jan 2006 21:52:19 +0000 Subject: r13019: Again protect us against format string mismatches, with the new split out proto headers. The reason this is done in this way is that the attribute must be on the prototype, not the actual function defintion. Hence the macros which expand to nothing in the C file, but expand to an __attribute__ in the prototype header. Andrew Bartlett (This used to be commit a88933668f908a398bb0d8bc7dc39c96cee40de6) --- source4/script/mkproto.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/script/mkproto.pl') diff --git a/source4/script/mkproto.pl b/source4/script/mkproto.pl index 2332cb06ab..9939fe0bf7 100755 --- a/source4/script/mkproto.pl +++ b/source4/script/mkproto.pl @@ -72,13 +72,17 @@ sub print_header($$) my ($file, $header_name) = @_; print $file "#ifndef $header_name\n"; print $file "#define $header_name\n\n"; + print $file "#undef _PRINTF_ATTRIBUTE\n"; + print $file "#define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)\n"; print $file "/* This file was automatically generated by mkproto.pl. DO NOT EDIT */\n\n"; } sub print_footer($$) { my ($file, $header_name) = @_; - printf $file "\n#endif /* %s */\n", $header_name; + print $file "#undef _PRINTF_ATTRIBUTE\n"; + print $file "#define _PRINTF_ATTRIBUTE(a1, a2)\n"; + print $file "\n#endif /* $header_name */\n\n"; } sub handle_loadparm($$) -- cgit