[Bug preprocessor/89808] An option to disable warning "#pragma once in main file"

martin at log2 dot ch gcc-bugzilla@gcc.gnu.org
Sat Oct 5 16:32:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89808

martin at log2 dot ch <martin at log2 dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin at log2 dot ch

--- Comment #10 from martin at log2 dot ch <martin at log2 dot ch> ---
Just adding a second use-case.

Emacs with cmake-ide (using flycheck) shows warnings that update as you type.
They are generated by running the file through gcc, which could be a .hpp file.
This usually works well enough for interactive use. But it leaves you with an
irrelevant "#pragma once in main file" warning in the editor.

(Not sure if this whole setup is "legit", or if there are better alternatives.
It involves guessing which compile flags of some .cpp file belong to the .hpp
file being edited.)


More information about the Gcc-bugs mailing list