view gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-5.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR bootstrap/77676 - powerpc64 and powerpc64le stage2 bootstrap fail
   Test case from comment 6 on the bug.  */
/* { dg-do compile } */
/* { dg-options "-Wall -Werror" } */

struct A
{
  const char *a;
  int b;
  const char *c;
};

void bar (char *);

void
foo (struct A *p)
{
  char s[4096];
  const char *u = p->a;
  const char *t;
  while ((t = __builtin_strstr (u, "gcc/")))
    u = t + 4;

  /* Verfiy the following doesn't emit a warning.  */
  __builtin_sprintf (s, "%s:%i (%s)", u, p->b, p->c);
  bar (s);
}