Skip to content

#pragma diagnostic push/pop docs out of date re GCC #51472

@llvmbot

Description

@llvmbot
Bugzilla Link 52130
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @zygoloid

Extended Description

The clang docs at https://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas currently say:

In addition to all of the functionality provided by GCC’s pragma, Clang also allows you to push and pop the current warning state.

And:

That means that it is possible to use push and pop around GCC compatible diagnostics and Clang will push and pop them appropriately, while GCC will ignore the pushes and pops as unknown pragmas.

This is out-of-date as GCC has implemented #pragma GCC diagnostic push and #pragma GCC diagnostic pop since 4.6.0 (which was released over 10 years ago):

https://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions