This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C: Proposal: Warning using char* a; if(a == "")


>     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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]