From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23359 invoked by alias); 28 Nov 2013 08:40:01 -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 23324 invoked by uid 48); 28 Nov 2013 08:39:58 -0000 From: "andysem at mail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/59325] New: Provide a way to disable deprecated warnings Date: Thu, 28 Nov 2013 08:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: andysem at mail dot ru X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2013-11/txt/msg02868.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59325 Bug ID: 59325 Summary: Provide a way to disable deprecated warnings Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: andysem at mail dot ru In C++11 mode, libstdc++ marks some standard components from C++03 as deprecated and emits warnings whenever these components are used. In particular std::auto_ptr, std::bind1st and std::bind2nd are marked that way. While the standard lists these components as deprecated, they are still used in many libraries for portability reasons, so that the code compiles both in C++03 and C++11 modes. The problem is that the warnings are flagged not only for the libraries but also for the client's code that uses them, and for the client these warnings are useless and even harmful because they clutter the compiler output. The suggested solution to disable the warnings by adding compiler switches is too strong because not only libstdc++ warnings are disabled this way but also other deprecated warnings too. So, to sum up, my use case is as follows. Application A uses library B. A and B are in C++11, but B uses C++03 legacy components for portability. B has its own API and some parts of it get deprecated as new versions come out. The developer of A is interested in seeing warnings about those API deprecation, but not about B using legacy C++ internally. My proposal is to add a configuration macro that, when defined by the user, will disable deprecation warnings from libstdc++. This would solve the problem in my example - the developer of A would define this macro and only see the warnings from B and not libstdc++.