gcc/testsuite/c-c++-common/pr36513-2.c
raw| 1 | /* PR 36513: -Wlogical-op warns about strchr */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-Wlogical-op" } */ |
| 4 | /* { dg-skip-if "requires hosted libstdc++ for cstring" { ! hostedlib } } */ |
| 5 | #ifdef __cplusplus |
| 6 | #include <cstring> |
| 7 | #else |
| 8 | #include <string.h> |
| 9 | #endif |
| 10 | int main2 () |
| 11 | { |
| 12 | char *s, t; |
| 13 | strchr (s, t); |
| 14 | return 0; |
| 15 | } |