llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.16k stars 12.03k forks source link

declare some header file as common header for c and cpp #84108

Open HerrCai0907 opened 8 months ago

HerrCai0907 commented 8 months ago

I have created some common header file for c and cpp. But when I run clang-tidy for my cpp file, it throw lots of error for example use-using, c-style cast, etc. Is there any mechanism to identifier this header file and forbidden some cpp check when running clang-tidy?

llvmbot commented 8 months ago

@llvm/issue-subscribers-clang-tidy

Author: Congcong Cai (HerrCai0907)

I have created some common header file for c and cpp. But when I run clang-tidy for my cpp file, it throw lots of error for example use-using, c-style cast, etc. Is there any mechanism to identifier this header file and forbidden some cpp check when running clang-tidy?
PiotrZSL commented 8 months ago
extern "C" {
}

Could be used, some checks respect it.

HerrCai0907 commented 8 months ago
extern "C" {
}

Could be used, some checks respect it.

But then I need to wrapper all context in extern "C" including #include .... It looks weird.