Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/gcc/testsuite/gcc.dg/Wwrite-strings-1.c
2023-03-06 14:48:14 +01:00

8 lines
389 B
C

/* Test pointer initialization and dereference don't lose qualifiers
on array types. This test wrongly failed to diagnose the loss of
const. */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "-Wwrite-strings" } */
typedef char T[1];
T *p = &""; /* { dg-warning "initialization discards 'const' qualifier from pointer target type" } */