From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id 9FF7C3857C6B for ; Thu, 6 Aug 2020 19:19:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9FF7C3857C6B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-_Sx31-nGNbimZ5cN5zMn8w-1; Thu, 06 Aug 2020 15:19:49 -0400 X-MC-Unique: _Sx31-nGNbimZ5cN5zMn8w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B73E0805721; Thu, 6 Aug 2020 19:19:47 +0000 (UTC) Received: from localhost (unknown [10.33.36.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AA2B19C71; Thu, 6 Aug 2020 19:19:46 +0000 (UTC) Date: Thu, 6 Aug 2020 20:19:46 +0100 From: Jonathan Wakely To: Martin Sebor Cc: Jakub Jelinek , Martin Sebor , libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [committed] libstdc++: Replace operator>>(istream&, char*) [LWG 2499] Message-ID: <20200806191946.GH3400@redhat.com> References: <20200805212500.GA2013665@redhat.com> <5a18ba7e-e550-72b9-150f-ce7abed339fd@redhat.com> <20200806131448.GY3400@redhat.com> <20200806132648.GW2363@tucnak> <20200806140114.GA3400@redhat.com> <20200806144526.GB3400@redhat.com> <67df1212-b427-013c-b9a2-74cf8354d114@gmail.com> <20200806160053.GD3400@redhat.com> <31a0e9f8-9df0-8ff5-208f-7e0a7c785acc@gmail.com> MIME-Version: 1.0 In-Reply-To: <31a0e9f8-9df0-8ff5-208f-7e0a7c785acc@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2020 19:19:52 -0000 On 06/08/20 12:45 -0600, Martin Sebor via Libstdc++ wrote: >On 8/6/20 10:00 AM, Jonathan Wakely wrote: >>On 06/08/20 09:17 -0600, Martin Sebor via Libstdc++ wrote: >>>Sorry.  I don't see this exercise as a complete waste of time >>>(but I understand why it feels like that to you). >>> >>>What it highlights is the fact that the warning infrastructure >>>we have in place is far from optimal for C++ in general (with >>>its heavy reliance on ilining and templates) and the standard >>>library in particular (especially with -Wno-system-headers). >>>We should make an effort to do better. >>> >>>Setting aside the effort to clean up the library so that it can >>>be used even with -Wsystem-headers, >> >>Yeah, it's an ongoing effort. >> >>>warnings about out of bounds >>>accesses should trigger even with -Wno-system-headers.  If one >>>doesn't I'd tend to view it as a bug. >> >>I agree. And __attribute__((__warning__(""))) too. > >I've opened four bugs to track some of the issues we've discussed: >96502, 96503, and 96505 for the lost attribute effect after >inlining, and 96508 for the system header interaction. I wasn't >able to reproduce the problem you're having with the attribute >(calling an out-of-line function declared in a system header >does produce a warning) so if you're not completely put off >by your experience so far please take a look at it and see >what I may have missed. This preprocessed code fails to warn without -Wsystem-headers: # 1 "user.C" # 1 "sys.h" 1 # 2 "sys.h" 3 # 3 "sys.h" 3 __attribute__((warning("badness"))) void diagnose_badness(); template void foo(T t) { if (t < 0) diagnose_badness(); } # 2 "user.C" 2 # 3 "user.C" int main() { int i = -1; foo(i); }