This is the mail archive of the
mailing list for the GCC project.
C: Proposal: Warning using char* a; if(a == "")
- To: gcc at gcc dot gnu dot org
- Subject: C: Proposal: Warning using char* a; if(a == "")
- From: Peter Schlaile <udbz at rz dot uni-karlsruhe dot de>
- Date: Thu, 4 Nov 1999 23:30:31 +0100 (CET)
would it be possible, that the following code generates a -Wall warning:
void GetDiskFreeSpaceA( char* root )
if ((!root) || (root == "\\"))
The underlined code is perfectly legal but IMHO never makes sense. It took
me a lot of time to hunt down this bug, so a little help by the compiler
would be nice. (I used egcs-2.91.60, if it is fixed already, I'm sorry
having bothered you... )
"Warning! Expression has no effect! You probably wanted to use strcmp()"
Peter Schlaile *** eMail email@example.com