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: [PATCH] Fix PR middle-end/37669


Jakub Jelinek writes:
> Yes, that looks better, though I'd call the var arg_idx, not len_arg, as it
> is len only for certain type values, it is a string for others.

I see.  Thanks.

> Also, you should include a testcase with the patch, e.g.
> following testcase reproduces it well for me:
> 
> --- gcc/testsuite/gcc.c-torture/compile/pr37669.c	2008-09-30 10:18:57.740011359 +0200
> +++ gcc/testsuite/gcc.c-torture/compile/pr37669.c	2008-10-20 23:44:27.000000000 +0200
> @@ -0,0 +1,14 @@
> +/* PR middle-end/37669 */
> +
> +#define FMT10 "%d%d%d%d%d%d%d%d%d%d"
> +#define FMT100 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10
> +#define FMT1000 FMT100 FMT100 FMT100 FMT100 FMT100 \
> +		FMT100 FMT100 FMT100 FMT100 FMT100
> +#define ARG10 , i, i, i, i, i, i, i, i, i, i
> +#define ARG100 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10 ARG10
> +#define ARG1000 ARG100 ARG100 ARG100 ARG100 ARG100 \
> +		ARG100 ARG100 ARG100 ARG100 ARG100
> +void foo (char *s, int i, int j)
> +{
> +  __builtin___snprintf_chk (s, i, 1, j, FMT1000 ARG1000);
> +}

The testcase is already in the testsuite per

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37669#c8

Adam


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