public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/109916] New: warning reported despite of "#pragma GCC diagnostic ignored", due to -flto
@ 2023-05-20 10:48 bruno at clisp dot org
2023-05-20 11:08 ` [Bug ipa/109916] " amonakov at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: bruno at clisp dot org @ 2023-05-20 10:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109916
Bug ID: 109916
Summary: warning reported despite of "#pragma GCC diagnostic
ignored", due to -flto
Product: gcc
Version: 13.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: bruno at clisp dot org
CC: marxin at gcc dot gnu.org
Target Milestone: ---
Created attachment 55127
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55127&action=edit
test case sources s.tar.xz
When adding option '-flto' to the gcc command line, diagnostics that are
ordinarily suppressed through "#pragma GCC diagnostic ignored ..." get reported
nevertheless.
How to reproduce:
1. Unpack the attached sources s.tar.xz.
$ gcc --version
gcc (GCC) 13.1.0
...
$ gcc -Wmaybe-uninitialized -O2 s/*.c -o cut
<no diagnostic>
$ gcc -Wmaybe-uninitialized -O2 s/*.c -o cut -flto
In function ‘getndelim2’,
inlined from ‘cut_fields’ at s/cut.c:5185:17:
s/getndelim2.c:2015:23: warning: ‘c’ may be used uninitialized
[-Wmaybe-uninitialized]
2015 | *read_pos = c;
| ^
s/getndelim2.c: In function ‘cut_fields’:
s/getndelim2.c:1934:11: note: ‘c’ was declared here
1934 | int c;
| ^
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug ipa/109916] warning reported despite of "#pragma GCC diagnostic ignored", due to -flto
2023-05-20 10:48 [Bug ipa/109916] New: warning reported despite of "#pragma GCC diagnostic ignored", due to -flto bruno at clisp dot org
@ 2023-05-20 11:08 ` amonakov at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: amonakov at gcc dot gnu.org @ 2023-05-20 11:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109916
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
CC| |amonakov at gcc dot gnu.org
--- Comment #1 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
There's a family of similar reports that "late" warnings do not observe this
pragma under LTO. I think it's best to make this a dup of the "canonical" PR.
*** This bug has been marked as a duplicate of bug 80922 ***
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-20 11:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-20 10:48 [Bug ipa/109916] New: warning reported despite of "#pragma GCC diagnostic ignored", due to -flto bruno at clisp dot org
2023-05-20 11:08 ` [Bug ipa/109916] " amonakov at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).