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]

Re: Patch to add __builtin_printf -> fputs transformations


On Tue, 19 Sep 2000, Bruce Korb wrote:

> It fails because the ``if [ -f include/stdio.h ]'' file used to have
> effective self-exclusionary text in it.  Your patch whacks that,
> surely costing whatever has been gained.  How about this?  You get
> your include stuck on the end and the stdio.h file stays wrapped.
> Besides, someday somebody (not me ;) ought to combine the fix-headers
> with fixincludes anyway.....
> 
>   fix = {
>     hackname  = get_stdout;
>     files     = stdio.h;
>     c_fix     = wrap;
>     c_fix_arg = "";
>     c_fix_arg = "#include <stdio-opt.h>\n";
>   };

In general, when wrapping <stdio.h> you need to be very careful about not
interfering with glibc's __need_FILE.  That is, any wrapper applied to
glibc's <stdio.h> must _not_ have multiple-include protection, since if it
does, one header includes <stdio.h> with __need_FILE defined and then if
the program has a later direct include of <stdio.h> that doesn't work if a
wrapper prevents reinclusion.

-- 
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]