warn-write-strings.c 279 B

12345678910
  1. // RUN: %clang_cc1 -verify -fsyntax-only -fconst-strings %s
  2. // PR4804
  3. char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char [4]' discards qualifiers}}
  4. // PR7192
  5. #include <stddef.h>
  6. void test(wchar_t *dst) {
  7. dst[0] = 0; // Ok.
  8. }