Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/pr81345.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line source
/* PR other/81345 - -Wall resets -Wstringop-overflow to 1 from the default 2 { dg-do compile } { dg-options "-O2 -Wall -Wno-array-bounds" } */ char a[3]; void f (const char *s) { __builtin_strncpy (a, s, sizeof a + 1); /* { dg-warning "\\\[-Wstringop-overflow=]" } */ } struct S { char a[3]; int i; }; void g (struct S *d, const char *s) { __builtin_strncpy (d->a, s, sizeof d->a + 1); /* { dg-warning "\\\[-Wstringop-overflow=]" } */ }