[LLVMbugs] [Bug 6163] Warn when comparing two arrays

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 8 12:50:54 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=6163

Douglas Gregor <dgregor at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Douglas Gregor <dgregor at apple.com> 2010-06-08 14:50:53 CDT ---
(In reply to comment #4)
> Created an attachment (id=4965)
 --> (http://llvm.org/bugs/attachment.cgi?id=4965) [details]
> array checks
> 
> This time with diagnostics that don't break localization, fixed LE GE, more
> tests.

Much improved! I've committed a slightly-tweaked version here:

 
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100607/031066.html

I removed this particular change, which doesn't seem necessary or related:

   if (!lType->isFloatingType()
-      && !(lType->isBlockPointerType() && isRelational)) {
+      && !lType->isBlockPointerType()) {

Also, I excluded VarDecls of reference type from the array-comparison warning,
since the result of such a comparison won't always be constant.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list