[cfe-commits] r39516 - /cfe/cfe/trunk/Driver/clang.cpp

clattner at cs.uiuc.edu clattner at cs.uiuc.edu
Wed Jul 11 09:45:12 PDT 2007


Author: clattner
Date: Wed Jul 11 11:45:12 2007
New Revision: 39516

URL: http://llvm.org/viewvc/llvm-project?rev=39516&view=rev
Log:
Fix two bugs that fell out from a testcase steve noticed.  for this testcase:

extern int pintFunc(int *, int *);

int test() {
  pintFunc(0,
           3);
}

We now print:

t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast
  pintFunc(0,
  ~~~~~~~~  ^

instead of:

t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast
  pintFunc(0,
  ~~~~~~~~

Modified:
    cfe/cfe/trunk/Driver/clang.cpp

Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=39516&r1=39515&r2=39516&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:45:12 2007
@@ -546,10 +546,10 @@
       HighlightRange(Ranges[i], LineNo, CaratLine, SourceLine);
     
     // Next, insert the carat itself.
-    if (ColNo < CaratLine.size())
+    if (ColNo-1 < CaratLine.size())
       CaratLine[ColNo-1] = '^';
     else
-      CaratLine.push_back(ColNo);
+      CaratLine.push_back('^');
     
     // Scan the source line, looking for tabs.  If we find any, manually expand
     // them to 8 characters and update the CaratLine to match.





More information about the cfe-commits mailing list