Author: abartlet Date: 2006-01-18 21:52:19 +0000 (Wed, 18 Jan 2006) New Revision: 13019
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13019 Log: 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 Modified: branches/SAMBA_4_0/source/include/includes.h branches/SAMBA_4_0/source/script/mkproto.pl Changeset: Modified: branches/SAMBA_4_0/source/include/includes.h =================================================================== --- branches/SAMBA_4_0/source/include/includes.h 2006-01-18 21:41:24 UTC (rev 13018) +++ branches/SAMBA_4_0/source/include/includes.h 2006-01-18 21:52:19 UTC (rev 13019) @@ -112,12 +112,13 @@ #include "auth/credentials/credentials.h" #include "libcli/nbt/libnbt.h" -/***** automatically generated prototypes *****/ -#include "include/proto.h" -#include "basic.h" #undef _PRINTF_ATTRIBUTE #define _PRINTF_ATTRIBUTE(a1, a2) +/***** automatically generated prototypes *****/ +#include "basic.h" +#include "include/proto.h" + /* String routines */ #include "safe_string.h" Modified: branches/SAMBA_4_0/source/script/mkproto.pl =================================================================== --- branches/SAMBA_4_0/source/script/mkproto.pl 2006-01-18 21:41:24 UTC (rev 13018) +++ branches/SAMBA_4_0/source/script/mkproto.pl 2006-01-18 21:52:19 UTC (rev 13019) @@ -72,13 +72,17 @@ 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($$)