Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is is possible to disable this warning in clang? warning: #pragma once in main file

Tags:

warning: #pragma once in main file

We're running our headers through clang to get a partial AST.

Is it possible to disable that warning?

like image 624
kylawl Avatar asked May 24 '13 01:05

kylawl


People also ask

How do I turn off clang warning?

Using _Pragma to suppress the warning. Using #pragma to suppress the warning. Using command line options to suppress the warning.

How do I turn off warnings in GCC?

-w is the GCC-wide option to disable warning messages.

How do I disable clang tidy?

To suppress a Clang-Tidy check for a particular line, use the Suppress "check_name" for line option. CLion will add a // NOLINT comment at the end of the selected line.

How do you suppress warnings in C++?

To disable a set of warnings for a given piece of code, you have to start with a “push” pre-processor instruction, then with a disabling instruction for each of the warning you want to suppress, and finish with a “pop” pre-processor instruction.


1 Answers

Use the -Wno-pragma-once-outside-header command line argument. Consult the Clang documentation here.

like image 185
W1M0R Avatar answered Nov 11 '22 08:11

W1M0R