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

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 24 06:30:26 GMT 2023


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=47857

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Diego SC from comment #13)
> Another use case.
> 
> We are using precompiled headers in our application, and that includes
> headers which have "#pragma once". When generating the precompiled header we
> get this warning:
> 
>   warning: #pragma once in main file
> 
> In that context the warning is actually invalid, so it would be really nice
> to be able to turn this warning off, without turning off all warnings.

That is PR 47857 .


More information about the Gcc-bugs mailing list