1 /* { dg-do compile } */
2 /* { dg-options "-Wall" } */
4 typedef __SIZE_TYPE__
size_t;
9 void *memset (void *, int, size_t);
15 memset (buf
, sizeof buf
, 0); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
16 memset (buf
, sizeof buf
, '\0'); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
17 memset (buf
, sizeof buf
, L
'\0'); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
18 memset (buf
, 1, 1 - 1);
19 memset (buf
, 1, 0 - 0);
21 memset (buf
, '\0', 0);
22 memset (buf
, L
'\0', 0);
23 memset (buf
, 1 - 1, 0); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
24 memset (buf
, 0 - 0, 0); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
25 memset (buf
, sizeof buf
, 0L); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
26 memset (buf
, sizeof buf
, 0UL); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
27 memset (buf
, sizeof buf
, 0LL); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
28 memset (buf
, sizeof buf
, 0ULL); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
29 memset (buf
, sizeof buf
, (int) 0);
30 memset (buf
, sizeof buf
, -0);