[PATCH] D52791: [Diagnostics] Check for misleading pointer declarations

2018-10-06 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 abandoned this revision. xbolva00 added a comment. This shouldn't be implemented here, better choice is clang-tidy. Closing this revision. https://reviews.llvm.org/D52791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D52791: [Diagnostics] Check for misleading pointer declarations

2018-10-03 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. void test(void) { int *a; int* b; } TranslationUnitDecl `-FunctionDecl line:4:6 test 'void ()' `-CompoundStmt |-DeclStmt | `-VarDecl col:10 a 'int *' `-DeclStmt `-VarDecl col:10 b 'int *' Why not 'int*' in ast dump?

[PATCH] D52791: [Diagnostics] Check for misleading pointer declarations

2018-10-03 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D52791#1254559, @rsmith wrote: > int *ptr, (a), b, c; > Another possible heuristic for suppressing the check: only warn if there is whitespace before the identifier. So: int* a, b; // warning int *a, b; // no warning

[PATCH] D52791: [Diagnostics] Check for misleading pointer declarations

2018-10-03 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. I think we need some documented guidelines on what is and is not an appropriate warning for Clang. I think it's reasonable to warn in cases where we are confident that the code means something other than what the programmer or a later reader is likely to expect; it's

[PATCH] D52791: [Diagnostics] Check for misleading pointer declarations

2018-10-03 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Yes, I am gonna work on it after I finish my some other patch :) https://reviews.llvm.org/D52791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52791: [Diagnostics] Check for misleading pointer declarations

2018-10-03 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. There's a false positive. int **A, *B; // false positive: declaring a variable of type 'int *'; did you mean to declare a pointer? And IMO this should also warn: int **A, B; // no warning currently https://reviews.llvm.org/D52791

[PATCH] D52791: [Diagnostics] Check for misleading pointer declarations

2018-10-03 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Any futher comments? https://reviews.llvm.org/D52791 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits