This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c/7776: const char* p = "foo"; if (p == "foo") ... is compiledwithout warning!
- From: Peter Schlaile <udbz at rz dot uni-karlsruhe dot de>
- To: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 30 Aug 2002 18:06:01 -0000
- Subject: Re: c/7776: const char* p = "foo"; if (p == "foo") ... is compiledwithout warning!
- Reply-to: Peter Schlaile <udbz at rz dot uni-karlsruhe dot de>
The following reply was made to PR c/7776; it has been noted by GNATS.
From: Peter Schlaile <udbz@rz.uni-karlsruhe.de>
To: Andrew Pinski <pinskia@physics.uc.edu>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/7776: const char* p = "foo"; if (p == "foo") ... is compiled
without warning!
Date: Fri, 30 Aug 2002 19:57:40 +0200 (CEST)
Hi,
On Fri, 30 Aug 2002, Andrew Pinski wrote:
> Are you asking for a warning so that the warning would suggest strcmp?
That was the intended idea, yes!
> The code you provide does make sense to check for if the two occurrences
> of "foo" are the same because the C standard does not say if they have
> to be the same.
Yup!
Greetings,
Peter
---
Peter Schlaile *** eMail udbz@rz.uni-karlsruhe.de
So Linus, what are we doing tonight?
The same thing we do every night Tux. Try to take over the world!