This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C: Proposal: Warning using char* a; if(a == "")
- To: gcc at gcc dot gnu dot org
- Subject: Re: C: Proposal: Warning using char* a; if(a == "")
- From: Tom Truscott <trt at unx dot sas dot com>
- Date: Fri, 5 Nov 1999 12:01:01 -0500 (EST)
> if (root == "\\")
There is a patch to gcc that issues warnings for these mistakes;
http://egcs.cygnus.com/ml/gcc-patches/1999-10/msg00548.html
The warning is turned on by the -W option.
It has not yet been adopted for gcc, but maybe someday...
In the meantime you can apply the patch on your own, as I do.
Tom Truscott
P.S. I have since changed the warning text from "string constant"
to "string literal", which I think is more pedantically correct.