[PATCH] D12473: [clang-tidy] Add old style function check

Piotr Dziwinski via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 30 13:39:00 PDT 2015


piotrdz added a comment.

@Eugene: I don't understand, what does declaring function with "void" argument have in common with this review? I only check here variable declarations inside functions.

Maybe you meant my other review for inconsistent declaration parameter names? If so, this is how it behaves currently:

  $ cat test.c
  void allright();
  void allright(void);
  
  void notallright(int a);
  void notallright(int b);
  
  $ clang-tidy -checks='-*,readability-inconsistent-declaration-parameter-name' test.c -- -std=c11
  1 warning generated.
  /work/clang-trunk/test.c:4:6: warning: function 'notallright' has other declaration with different parameter name(s) [readability-inconsistent-declaration-parameter-name]
  void notallright(int a);
       ^
  /work/clang-trunk/test.c:5:6: note: other declaration seen here
  void notallright(int b);

So I see no reason to add specific checks for functions with "void" parameter, unless you see something wrong with this behavior?


http://reviews.llvm.org/D12473





More information about the cfe-commits mailing list