Skip to content

[GNATS 25962] Assertion failure on invalid diag_suppress pragma #19

Description

@jhsedg

Description

​#pragma diagnostic push
​#pragma diag_suppress
​int get_free_no_warn()
​{
​ // warnings for uninitialized variable off
​ int a;
​ return a;
​ // warnings for uninitialized variable on
​}
​#pragma diagnostic pop
​
​int get_free_warn()
​{
​ int a;
​ return a;
​}
​
​:!$XCFE test.cpp
​"test.cpp", line 2: warning: expected an error number or error tag
​ #pragma diag_suppress
​ ^
​
​"test.cpp", line 2: warning: expected a ","
​ #pragma diag_suppress
​ ^
​
​"test.cpp", line 2: internal error: assertion failed at: "pragma.c", line 1192
​ in process_immediate_pragmas
​
​ #pragma diag_suppress
​ ^
​
​1 catastrophic error detected in the compilation of "test.cpp".
​Compilation aborted.

Activity

  1. mohitmishra786 commented on Oct 10, 2026

    @mohitmishra786
    Contributor

    @daveedvdv @nv-cmeerw this can be closed as fix of this is already done
    #203

    and the commits are already on main
    here's the commit
    e24bb9ace2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions