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]
Other format: [Raw text]

Re: (fixinc) PATCH: Handle BSD4.4 <stdio.h> vs. attribute format checking


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]