On Wed, 2020-01-08 at 12:52 +0100, Andreas Schwab wrote:
> On Dez 06 2019, Martin Sebor wrote:
> 
> > diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c 
> > b/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c
> > new file mode 100644
> > index 00000000000..249ce2b6ad5
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-27.c
> > +void test_strcpy_warn (const char *s)
> > +{
> > +  {
> > +    const char a[] = "123";
> > +    /* Verify that using signed int for the strlen result works (i.e.,
> > +       that the conversion from signed int to size_t doesn't prevent
> > +       the detection.  */
> > +    int n = strlen (a);
> > +    char *t = (char*)calloc (n, 1);     // { dg-message "at offset 0 to an 
> > object with size 3 allocated by 'calloc' here" "calloc note" { xfail *-*-* 
> > } }
> > +                                        // { dg-message "at offset 0 to an 
> > object with size at most 3 allocated by 'calloc' here" "calloc note" { 
> > target *-*-* } .-1 }
> 
> Please make the test name unique.
I've got a patch to do that in my local tree.  I'll push it
momentarily.

jeff

Reply via email to