Skip to content
  1. Aug 17, 2007
  2. Aug 16, 2007
    • Steve Naroff's avatar
      · cdee44c1
      Steve Naroff authored
      Fixed Sema::CheckEqualityOperands() and Sema::CheckRelationalOperands() to deal more 
      thoughtfully with incompatible pointers. This includes:
      
      - Emit a diagnostic when two pointers aren't compatible!
      - Promote one of the pointers/integers so we maintain the invariant expected by the 
      code generator (i.e. that the left/right types match).
      - Upgrade the pointer/integer comparison diagnostic to include the types. 
      
      llvm-svn: 41127
      cdee44c1
    • Ted Kremenek's avatar
      Added a comment to ArraySubscriptExpr to note that the expressions like · 248d5b27
      Ted Kremenek authored
      "A[4]" are equivalent to "4[A]", and that a test that the expression
      returned by "getBase()" has a pointer type is required to resolve which
      subexpression is the "true" base expression of the array index.
      
      llvm-svn: 41113
      248d5b27
  3. Aug 15, 2007
    • Ted Kremenek's avatar
      Added the following utility methods to VarDecl that provide · 85786be8
      Ted Kremenek authored
      canonicalized queries of a variable's storage:
      
        hasAutoStorage - Does a variable have (implicit) auto storage?
      
        hasStaticStorage - Does a variable have (implicit) static storage?
      
        hasLocalStorage - Is the variable a non-static local variable?
      
        hasGlobalStorage - Is the variable a global variable or a static
                           local variable?
      
      Additional comments documenting these functions are included in the
      source.
      
      llvm-svn: 41092
      85786be8
  4. Aug 14, 2007
    • Ted Kremenek's avatar
      Removed dead variable "hadError" in ParseReturnStmt. · c48affb8
      Ted Kremenek authored
      llvm-svn: 41079
      c48affb8
    • Ted Kremenek's avatar
      Added support for additional format string checking for the printf · e68f1aad
      Ted Kremenek authored
      family of functions.  Previous functionality only included checking to
      see if the format string was a string literal.  Now we check parse the
      format string (if it is a literal) and perform the following checks:
      
      (1) Warn if: number conversions (e.g. "%d") != number data arguments.
      
      (2) Warn about missing format strings  (e.g., "printf()").
      
      (3) Warn if the format string is not a string literal.
      
      (4) Warn about the use se of '%n' conversion.  This conversion is
          discouraged for security reasons.
      
      (5) Warn about malformed conversions.  For example '%;', '%v'; these
          are not valid.
      
      (6) Warn about empty format strings; e.g. printf("").  Although these
          can be optimized away by the compiler, they can be indicative of
          broken programmer logic.  We may need to add additional support to
          see when such cases occur within macro expansion to avoid false
          positives.
      
      (7) Warn if the string literal is wide; e.g. L"%d".
      
      (8) Warn if we detect a '\0' character WITHIN the format string.
      
      Test cases are included.
      
      llvm-svn: 41076
      e68f1aad
    • Ted Kremenek's avatar
      Added documentation to StringLiteral noting that the strings returned by · 86aeed92
      Ted Kremenek authored
      getStrData() are not null-terminated, and the lengths of these strings should
      be determined using getByteLength().
      
      llvm-svn: 41055
      86aeed92
  5. Aug 11, 2007
  6. Aug 10, 2007
  7. Aug 09, 2007
  8. Aug 08, 2007
  9. Aug 07, 2007
  10. Aug 05, 2007
    • Steve Naroff's avatar
      · 04e8bc8e
      Steve Naroff authored
      Remove a space from "typeof" printing. It was causing the following error...
      
      [dylan:clang/test/Parser] admin% ../../../../Debug/bin/clang -parse-ast-check typeof.c 
      Warnings expected but not seen:
        Line 21: incompatible types assigning 'typeof(*pi) const' to 'int *'
      Warnings seen but not expected:
        Line 21: incompatible types assigning 'typeof(*pi)  const' to 'int *'
      
      Also corrected a typo from my previous commit.
      
      llvm-svn: 40832
      04e8bc8e
    • Steve Naroff's avatar
      · 8a4cf97a
      Steve Naroff authored
      Make sure the good old "function/array conversion" is done to function parameters.
      
      This resulted in the following error...
      
      [dylan:clang/test/Parser] admin% cat parmvardecl_conversion.c 
      // RUN: clang -parse-ast-check %s
      
      void f (int p[]) { p++; }
      
      [dylan:clang/test/Parser] admin% clang -parse-ast-check parmvardecl_conversion.c 
      Errors seen but not expected:
        Line 3: cannot modify value of type 'int []'
      
      With this fix, the test case above succeeds.
      
      llvm-svn: 40831
      8a4cf97a
Loading