[LLVMbugs] [Bug 7555] New: Warn for missing braces around indented statements

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 1 19:46:09 PDT 2010


           Summary: Warn for missing braces around indented statements
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jediknil at belkadan.com
                CC: llvmbugs at cs.uiuc.edu

Might be a dream, but Clang should have a warning for this sort of code:

if (!valid(str))
  log("Invalid input: %s", str);
  return NULL;
return process(str);

The "return NULL" line is clearly supposed to be part of the consequent block.

A fixit would be nice but not always correct, since maybe a user just forgot to
dedent in some cases.

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