From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108991 invoked by alias); 30 Jul 2015 17:22:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 108956 invoked by uid 48); 30 Jul 2015 17:22:21 -0000 From: "miyuki at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53431] C++ preprocessor ignores #pragma GCC diagnostic Date: Thu, 30 Jul 2015 17:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.7.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: miyuki at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg02659.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431 Mikhail Maltsev changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |miyuki at gcc dot gnu.org --- Comment #26 from Mikhail Maltsev --- Probably, you could use __attribute__((unused)) as a workaround. Some wrapper macro can make it less verbose, e.g. like here: https://github.com/gcc-mirror/gcc/blob/master/include/ansidecl.h#L157 https://github.com/gcc-mirror/gcc/blob/master/gcc/c-family/c-common.c#L6980 You can then add "ARG_UNUSED(x)=x" (or "__attribute__(x)=") to PREDEFINED parameter of your doxygen config (you did not mention the documentation system, but doxygen is used on cryptopp.com). I.e. in your code you'll have: int Foo(int ARG_UNUSED(bar)); the compiler will see it as: int Foo(int bar __attribute__((unused))); and doxygen (and other compilers, if you tweak the macro a bit) as: int Foo(int bar);