This is the mail archive of the gcc-prs@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]
Other format: [Raw text]

Re: c/7776: const char* p = "foo"; if (p == "foo") ... is compiled without warning!


The following reply was made to PR c/7776; it has been noted by GNATS.

From: Andrew Pinski <pinskia@physics.uc.edu>
To: udbz@rz.uni-karlsruhe.de
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 13:35:21 -0400

 Are you asking for a warning so that the warning would suggest strcmp?
 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.
 
 Thanks,
 Andrew Pinski
 


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