please don't use #pragma GCC system_header

Michael Stahl mstahl at redhat.com
Thu Nov 14 07:13:59 PST 2013


On 14/11/13 13:25, Eike Rathke wrote:
> Hi,
> 
> On Thursday, 2013-11-14 11:25:32 +0100, Michael Stahl wrote:
> 
>> better to use "#pragma GCC diagnostic ignored" which does not have bad
>> side effects.
> 
> So actually the old advice to create a wrapper header for the reason to
> disable warnings for an included header is legacy and moot.

yes it is obsolete with current GCC versions.

> I assume that "#pragma GCC diagnostic ignored" can be pushed before and
> popped after an #include file to affect only that include, similar to
> what "#pragma warning(push, 1)" for _MSC_VER does?

yes with "#pragma GCC diagnostic push" / "pop" - requires a check for
HAVE_GCC_PRAGMA_DIAGNOSTIC_SCOPE since GCC is so behind the times wrt.
warnings this only got added in some 4.x version...

see e.g. NeonTypes.hxx for usage example.



More information about the LibreOffice mailing list