summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/Wmemset-transposed-args2.c
blob: 8647138cfc9183e5f57daf5283729096dafb08e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile { target { c || c++11 } } } */
/* { dg-options "-Wall" } */
/* { dg-additional-options "-std=gnu99" { target c } } */

typedef __SIZE_TYPE__ size_t;
extern
#ifdef __cplusplus
"C"
#endif
void *memset (void *, int, size_t);
char buf[1024];

void
foo ()
{
  memset (buf, sizeof buf, u'\0'); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
  memset (buf, sizeof buf, U'\0'); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
  memset (buf, u'\0', 0);
  memset (buf, U'\0', 0);
}