From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4C7D43945C14; Tue, 20 Oct 2020 14:46:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C7D43945C14 From: "andysem at mail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/59325] Provide a way to disable deprecated warnings Date: Tue, 20 Oct 2020 14:46:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: WAITING 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 14:46:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D59325 --- Comment #8 from andysem at mail dot ru --- (In reply to Jonathan Wakely from comment #6) > (In reply to andysem from comment #2) > > (In reply to Jonathan Wakely from comment #1) > > > You can use a #pragma to disable -Wdeprecated locally > >=20 > > But the legacy C++ is used in the library, which code I'd like to avoid > > changing. >=20 > Is this still a problem? Uses of deprecated features within the library > itself should no longer emit warnings (I think I've disabled them with > pragmas). >=20 > So the only uses should be in our own code, which you can add pragmas to. Yes, this is still a problem. To be clear, the library I was referring to w= as not libstdc++ but another library which I have no control of and which is s= till using C++03 features. I don't think it will move away from std::auto_ptr any time soon as it is part of the API. > If you want to ignore the warning because you know you're not going to us= e a > different implementation or a newer standard, you can use -Wno-deprecated= to > disable all such warnings globally or use #pragma to disable them locally. I don't want to disable _all_ deprecated warnings universally, only those emitted by libstdc++. For this reason I cannot use -Wno-deprecated. #pragma also doesn't really work because libstdc++ can be included from any header, including those from other libraries, for which I don't want to disable warnings.=