From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89207 invoked by alias); 22 Jul 2015 00:00: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 89137 invoked by uid 48); 22 Jul 2015 00:00:22 -0000 From: "noloader at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53431] C++ preprocessor ignores #pragma GCC diagnostic Date: Wed, 22 Jul 2015 00:00: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: noloader at gmail dot com 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: 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/msg01871.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431 --- Comment #13 from Jeffrey Walton --- This issued caused Crypto++ to remove -Wall (and above) under GCC. Crypto++ is C++ with lots of interfaces, and it performs a fair amount of intermediate calculations used in an assert. It really needed the following to work as expected: // GCC diagnostcs available after GCC 4.2 (https://gcc.gnu.org/ml/gcc-help/2015-07/msg00063.html) #define GCC_DIAGNOSTIC_AWARE ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) || defined(__clang__)) #if GCC_DIAGNOSTIC_AWARE # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-value" # pragma GCC diagnostic ignored "-Wunused-variable" #endif Crypto++ is fortunate in that its multi-compiler friendly and cross-platform. It can use Clang, ICC, Comeau or, say MSVC with /W4. Other projects are not so lucky. They include Asterisk (the PBX software package). Asterisk uses trampolines, so it cannot compile under Clang. And it never supported MSVC.