diff options
author | Roger Sayle <roger@eyesopen.com> | 2005-12-04 19:56:47 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2005-12-04 19:56:47 +0000 |
commit | e994a705a9d8447c17486c13d741c2692c475f67 (patch) | |
tree | 0c868f77e7b841472e04bdb16256459255a05c04 /libdecnumber/decNumber.h | |
parent | 93af36c5c18bae3a294d98e46300ea3a867ecf56 (diff) | |
download | gcc-e994a705a9d8447c17486c13d741c2692c475f67.zip gcc-e994a705a9d8447c17486c13d741c2692c475f67.tar.gz gcc-e994a705a9d8447c17486c13d741c2692c475f67.tar.bz2 |
re PR c/7776 (const char* p = "foo"; if (p == "foo") ... is compiled without warning!)
PR c/7776
* common.opt (Wstring-literal-comparison): New command line option.
* c-opts.c (c_common_handle_option): Set it with -Wall.
* c-typeck.c (parser_build_binary_op): Issue warning if either
operand of a comparison operator is a string literal, except for
testing equality or inequality against NULL.
* doc/invoke.texi: Document new -Wstring-literal-comparison option.
* gcc.dg/Wstring-literal-comparison-1.c: New test case.
* gcc.dg/Wstring-literal-comparison-2.c: Likewise.
* gcc.dg/Wstring-literal-comparison-3.c: Likewise.
* gcc.dg/Wstring-literal-comparison-4.c: Likewise.
From-SVN: r108018
Diffstat (limited to 'libdecnumber/decNumber.h')
0 files changed, 0 insertions, 0 deletions