This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52116] pragma GCC diagnostic only acts on some lines
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 04 Feb 2012 11:09:44 +0000
- Subject: [Bug c/52116] pragma GCC diagnostic only acts on some lines
- Auto-submitted: auto-generated
- References: <bug-52116-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52116
--- Comment #1 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-02-04 11:09:44 UTC ---
Created attachment 26572
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26572
patch to fix (2)
I am not surprised. Location information in GCC is not very precise. Have you
tested with GCC 4.7?
For 1), someone would need to look more closely at the locations recorded by
each pragma, and compare them with the locations of the diagnostic.
Fixing 2) is easier. Just check the output of the first diagnostic and only
emit the second if the output was true. Also, change the second warning() to
inform(). An untested patch attached. Feel free to take it, test it and submit
it. http://gcc.gnu.org/contribute.html