This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: (fixinc) PATCH: Handle BSD4.4 <stdio.h> vs. attribute format checking
- From: Bruce Korb <bkorb at veritas dot com>
- To: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- Cc: GCC-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 04 Apr 2003 10:43:59 -0800
- Subject: Re: (fixinc) PATCH: Handle BSD4.4 <stdio.h> vs. attribute format checking
- Reply-to: bkorb at veritas dot com
> Bi-yearly Ping: Permission from a fixinc maintainer to install on
> mainline? http://gcc.gnu.org/ml/gcc-patches/2002-06/msg02246.html
>
> [It is my fault that this one never got looked at since I didn't
> e-mail Bruce directly.]
Putting "fixinc" in the title works, too. :-)
> * fixinc/inclhack.def (bsd_stdio_attrs_conflict): New.
> * fixinc/fixincl.x: Rebuilt.
* fixinc/tests/base/stdio.h: regenerated
> /*
> + * Various systems derived from BSD4.4 contain a macro definition
> + * for vfscanf that interacts badly with requirements of builtin-attrs.def.
> + */
> + fix = {
> + hackname = bsd_stdio_attrs_conflict;
> + mach = *-*-*bsd*;
> + mach = *-*-*darwin*;
> + files = stdio.h;
> + select = "^#define[ \t]*vfscanf[ \t]*__svfscanf[ \t]*$";
> + c_fix = format;
> + c_fix_arg = '#define _BSD_STRING(_BSD_X) _BSD_STRINGX(_BSD_X)' "\n"
> + '#define _BSD_STRINGX(_BSD_X) #_BSD_X' "\n"
> + 'int vfscanf(FILE *, const char *, __builtin_va_list) '
> + '__asm__ (_BSD_STRING(__USER_LABEL_PREFIX__) "__svfscanf");';
> + test_text = '#define vfscanf __svfscanf';
> + };
Looks fine to me, as long as you include the make check updates to
fixinc/tests/base/stdio.h. I do have teeny nit that you needn't fix:
The "select" clause is a regular expression, not a sed expression,
so you can use "+" instead of "*" for repetition counts where appropriate.