Skip to content

#pragma clang diagnostic push ignores garbage at end of line without warning #13920

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 13548
Version 3.1
OS MacOS X
Reporter LLVM Bugzilla Contributor

Extended Description

I blithely wrote the following code:

#pragma clang diagnostic push ignored "-Wdeprecated-declarations"

Which should not be expected to work, nor is it documented to. Owing to a mental scotoma I could not comprehend why deprecated-declaration warning continued to be issued.
As it happens you can put nigh anything at the end of the line and the compiler will silently ignore it.

If the compiler had warned about the garbage, it would have saved me some mental anguish. Perhaps we need to add -Wextra-stuff-at-end-of-pragma. Or perhaps we don't need to make that one optional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions