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] adding missing LTO to some warning options (PR 78606)


On Jan 10 2017, Martin Sebor <msebor@gmail.com> wrote:

> Index: gcc/testsuite/gcc.dg/pr78768.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/pr78768.c	(revision 0)
> +++ gcc/testsuite/gcc.dg/pr78768.c	(working copy)
> @@ -0,0 +1,13 @@
> +/* PR c/78768 - -Walloca-larger-than and -Wformat-length warnings disabled
> +   by -flto
> +  { dg-do run }
> +  { dg-options "-O2 -Walloca-larger-than=10 -Wformat -Wformat-length -flto" } */
> +
> +int main (void)
> +{
> +  char *d = (char *)__builtin_alloca (12);  /* { dg-warning "argument to .alloca. is too large" } */
> +
> +  __builtin_sprintf (d, "%32s", "x");   /* { dg-warning "directive writing 32 bytes into a region of size 12" "-Wformat-length" { xfail *-*-* } } */
> +
> +  return 0;
> +}

Why is that a run test?  It cannot be usefully executed.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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