https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89808
Bug ID: 89808
Summary: Disable "#pragma once in main file"
Product: gcc
Version: 7.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: s_gcc_bugzilla at binarez dot com
Target Milestone: ---
I am building an environnement to execute c++ code and I do need to use #pragma
once in my main cpp source code (and all cpp files actually). When I compile, I
get the "#pragma once in main file" warning.
The only way to turn this warning off is to disable all warnings with the -w
option. I want to only disable this specific warning and keep all the other
ones. gcc needs something like clang's -Wno-pragma-once-outside-header option.
I do appreciate that this warning is actually useful but there are corner cases
where this warning must be disabled.