This is the mail archive of the
gcc@gcc.gnu.org
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)
Hi,
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... )
(A la:
"Warning! Expression has no effect! You probably wanted to use strcmp()"
)
Greetings,
Peter
---
Peter Schlaile *** eMail udbz@rz.uni-karlsruhe.de