brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · bbbf73f Raw
59 lines · c
1// RUN: clang-tidy -checks=-*,modernize-redundant-void-arg %s -- -Wno-strict-prototypes -x c | count 02 3#define NULL 04 5extern int i;6 7int foo2() {8  return 0;9}10 11int j = 1;12 13int foo(void) {14  return 0;15}16 17typedef unsigned int my_uint;18 19typedef void my_void;20 21// A function taking void and returning a pointer to function taking void22// and returning int.23int (*returns_fn_void_int(void))(void);24 25typedef int (*returns_fn_void_int_t(void))(void);26 27int (*returns_fn_void_int(void))(void) {28  return NULL;29}30 31// A function taking void and returning a pointer to a function taking void32// and returning a pointer to a function taking void and returning void.33void (*(*returns_fn_returns_fn_void_void(void))(void))(void);34 35typedef void (*(*returns_fn_returns_fn_void_void_t(void))(void))(void);36 37void (*(*returns_fn_returns_fn_void_void(void))(void))(void) {38  return NULL;39}40 41void bar(void) {42  int i;43  int *pi = NULL;44  void *pv = (void *) pi;45  float f;46  float *fi;47  double d;48  double *pd;49}50 51void (*f1)(void);52void (*f2)(void) = NULL;53void (*f3)(void) = bar;54void (*fa)();55void (*fb)() = NULL;56void (*fc)() = bar;57 58typedef void (function_ptr)(void);59