[PATCH] D70638: [Diagnostic] add a warning which warns about misleading indentation

Tyker via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 29 07:13:43 PST 2019


Tyker updated this revision to Diff 231534.
Tyker added a comment.

yeah i saw. this version of the patch builds all llvm subproject(not tested on llgo) without warnings. there is only one case in llvm's code in which this warning is more agressive thant GCC's.

  if (1)
    i = 0;
  
  // comment
    i = 1; //  clang + this patch warns through the comment wereas gcc doesn't.

i don't believe a warning in this case is too bad.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70638/new/

https://reviews.llvm.org/D70638

Files:
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Lex/Preprocessor.h
  clang/include/clang/Parse/Parser.h
  clang/lib/Parse/ParseStmt.cpp
  clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
  clang/test/Index/pragma-diag-reparse.c
  clang/test/Misc/warning-wall.c
  clang/test/Parser/warn-misleading-indentation.cpp
  clang/test/Preprocessor/pragma_diagnostic_sections.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70638.231534.patch
Type: text/x-patch
Size: 14215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191129/5e08b161/attachment-0001.bin>


More information about the cfe-commits mailing list