(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
Wmemset-transposed-args2.c
       1  /* { dg-do compile { target { c || c++11 } } } */
       2  /* { dg-options "-Wall" } */
       3  /* { dg-additional-options "-std=gnu99" { target c } } */
       4  
       5  typedef __SIZE_TYPE__ size_t;
       6  extern
       7  #ifdef __cplusplus
       8  "C"
       9  #endif
      10  void *memset (void *, int, size_t);
      11  char buf[1024];
      12  
      13  void
      14  foo ()
      15  {
      16    memset (buf, sizeof buf, u'\0'); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
      17    memset (buf, sizeof buf, U'\0'); /* { dg-warning ".memset. used with constant zero length parameter; this could be due to transposed parameters" } */
      18    memset (buf, u'\0', 0);
      19    memset (buf, U'\0', 0);
      20  }