Bug 79701 - #pragma ignored "-Wcomment" has no effect
Summary: #pragma ignored "-Wcomment" has no effect
Status: RESOLVED DUPLICATE of bug 53431
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 6.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-24 07:39 UTC by Damien GERARD
Modified: 2017-08-19 12:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Damien GERARD 2017-02-24 07:39:35 UTC
Hi,

It seems that `diagnostic ignored -Wcomment` has no effect.
Since nothing states that it does not work, I would expect no warning here.
Thanks :)

```
int main() {
    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wcomment"
    /* /* */
    #pragma GCC diagnostic pop
    return 0;
}

gcc -Wall /tmp/foo.cpp
/tmp/foo.cpp:5:5: warning: "/*" within comment [-Wcomment]
```
Comment 1 Damien GERARD 2017-02-24 12:01:43 UTC
behavior observed:
 - debian 9 with gcc 6.3 & 5.4
   gcc (Debian 6.3.0-7) 6.3.0 20170218
   gcc-5 (Debian 5.4.1-5) 5.4.1 20170205

 - CentOS 7.2 gcc 6.2 (rhel-devtoolset)
Comment 2 Manuel López-Ibáñez 2017-08-19 12:06:17 UTC
Dup

*** This bug has been marked as a duplicate of bug 53431 ***