CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
95 lines
4.3 KiB
C
95 lines
4.3 KiB
C
// RUN: clang-tidy %s -checks=-*,modernize-redundant-void-arg -- -std=c99 -Wno-strict-prototypes | count 0
|
|
// RUN: clang-tidy %s -checks=-*,modernize-redundant-void-arg -- -std=c11 -Wno-strict-prototypes | count 0
|
|
// RUN: clang-tidy %s -checks=-*,modernize-redundant-void-arg -- -std=c17 -Wno-strict-prototypes | count 0
|
|
// RUN: %check_clang_tidy -std=c23-or-later -check-suffixes=C23 %s modernize-redundant-void-arg %t
|
|
|
|
#include <stddef.h>
|
|
|
|
extern int i;
|
|
|
|
int foo2() {
|
|
return 0;
|
|
}
|
|
|
|
int j = 1;
|
|
|
|
int foo(void) {
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:9: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: int foo() {
|
|
return 0;
|
|
}
|
|
|
|
typedef unsigned int my_uint;
|
|
|
|
typedef void my_void;
|
|
|
|
// A function taking void and returning a pointer to function taking void
|
|
// and returning int.
|
|
int (*returns_fn_void_int(void))(void);
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:27: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-2]]:34: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: int (*returns_fn_void_int())();
|
|
|
|
typedef int (*returns_fn_void_int_t(void))(void);
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:37: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-2]]:44: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: typedef int (*returns_fn_void_int_t())();
|
|
|
|
int (*returns_fn_void_int(void))(void) {
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:27: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-2]]:34: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: int (*returns_fn_void_int())() {
|
|
return NULL;
|
|
}
|
|
|
|
// A function taking void and returning a pointer to a function taking void
|
|
// and returning a pointer to a function taking void and returning void.
|
|
void (*(*returns_fn_returns_fn_void_void(void))(void))(void);
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:42: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-2]]:49: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-3]]:56: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: void (*(*returns_fn_returns_fn_void_void())())();
|
|
|
|
typedef void (*(*returns_fn_returns_fn_void_void_t(void))(void))(void);
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:52: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-2]]:59: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-3]]:66: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: typedef void (*(*returns_fn_returns_fn_void_void_t())())();
|
|
|
|
void (*(*returns_fn_returns_fn_void_void(void))(void))(void) {
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:42: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-2]]:49: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-MESSAGES-C23: :[[@LINE-3]]:56: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: void (*(*returns_fn_returns_fn_void_void())())() {
|
|
return NULL;
|
|
}
|
|
|
|
void bar(void) {
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:10: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: void bar() {
|
|
int i;
|
|
int *pi = NULL;
|
|
void *pv = (void *) pi;
|
|
float f;
|
|
float *fi;
|
|
double d;
|
|
double *pd;
|
|
}
|
|
|
|
void (*f1)(void);
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:12: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: void (*f1)();
|
|
void (*f2)(void) = NULL;
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:12: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: void (*f2)() = NULL;
|
|
void (*f3)(void) = bar;
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:12: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: void (*f3)() = bar;
|
|
void (*fa)();
|
|
void (*fb)() = NULL;
|
|
void (*fc)() = bar;
|
|
|
|
typedef void (function_ptr)(void);
|
|
// CHECK-MESSAGES-C23: :[[@LINE-1]]:29: warning: redundant void argument list [modernize-redundant-void-arg]
|
|
// CHECK-FIXES-C23: typedef void (function_ptr)();
|