1 // RUN: %clang_cc1 -fsyntax-only -verify -Wall %s -std=c11
4 return a
== '\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
8 return '\0' == a
; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
12 return a
== L
'\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
16 return a
== u
'\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
20 return a
== U
'\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
24 return a
== (char)0; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
29 return a
== (my_char
)0;
30 // expected-warning@-1 {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
34 return a
!= '\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to (void *)0?}}
37 #define NULL (void *)0
39 return a
== '\0'; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to NULL?}}
44 return a
== (MYCHAR
)0; // expected-warning {{comparing a pointer to a null character constant; did you mean to compare to NULL?}}