Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clang tool: how to treat .h header as C++ file

I am trying with some clang extra tools such like clang-check, but I found it cannot handle .h file as expected, if the file is renamed as .hpp file, it will be OK, but I don't want to change the file extension. Is there any method to let the clang-check to treat .h header as c++ file?

like image 822
thisEric Avatar asked Sep 13 '25 16:09

thisEric


1 Answers

with -extra-arg-before=-xc++ option can resolve my problem

like image 181
thisEric Avatar answered Sep 16 '25 20:09

thisEric