From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0C4683858D38 for ; Wed, 5 Apr 2023 10:59:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0C4683858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680692383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4QvjkbvNLqsdS4CG5XpXZZ0X1MxyOfbWSp46m2VD6P0=; b=fjFrZbKTH+X+KFBUdeJVjRPx3ToVFOJvotfeRDwEA+hn93BXXq1Dvq6xSfiPTR2F5M2R3f tN4Ezd2n1ZB14liRiF1+OBywAWHu7QkPMBcmyH5pXJi6fZeMBgKPekLM0PJnaLZj/tf3x7 +IbSk8NW5GK15KmusXvKCZBCk+skNME= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-3-9j4i9HXUOvu4Ebmggp8wYA-1; Wed, 05 Apr 2023 06:59:40 -0400 X-MC-Unique: 9j4i9HXUOvu4Ebmggp8wYA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 155E385A588; Wed, 5 Apr 2023 10:59:40 +0000 (UTC) Received: from localhost (unknown [10.33.37.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE39C492C14; Wed, 5 Apr 2023 10:59:39 +0000 (UTC) Date: Wed, 5 Apr 2023 11:59:39 +0100 From: Jonathan Wakely To: Arsen =?utf-8?Q?Arsenovi=C4=87?= Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [PATCH 2/4] libstdc++: Add a test for FTM redefinitions Message-ID: References: <20230404230950.158556-1-arsen@aarsen.me> <20230404230950.158556-2-arsen@aarsen.me> MIME-Version: 1.0 In-Reply-To: <20230404230950.158556-2-arsen@aarsen.me> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 05/04/23 01:09 +0200, Arsen Arsenović wrote: >This test detects redefinitions by compiling stdc++.h with >-Wsystem-headers. Thanks Patrick Palka for the suggestion. > >libstdc++-v3/ChangeLog: > > * testsuite/17_intro/versionconflict.cc: New test. >--- > libstdc++-v3/testsuite/17_intro/versionconflict.cc | 6 ++++++ > 1 file changed, 6 insertions(+) > create mode 100644 libstdc++-v3/testsuite/17_intro/versionconflict.cc > >diff --git a/libstdc++-v3/testsuite/17_intro/versionconflict.cc b/libstdc++-v3/testsuite/17_intro/versionconflict.cc >new file mode 100644 >index 00000000000..4191c7a2b08 >--- /dev/null >+++ b/libstdc++-v3/testsuite/17_intro/versionconflict.cc >@@ -0,0 +1,6 @@ >+// { dg-do preprocess } >+// { dg-additional-options "-Wsystem-headers -Werror" } >+ >+// Test for redefinitions of FTMs using bits/stdc++.h. >+#include >+#include I'm concerned that this will fail if libc headers have macro redefinition errors, or anything else that would usually be ignored. We could make it more robust by changing like so: --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -30,7 +30,9 @@ #ifndef _GLIBCXX_VERSION_INCLUDED #define _GLIBCXX_VERSION_INCLUDED +#ifndef _GLIBCXX_TESTING_SYSHDR #pragma GCC system_header +#endif #include Then the test could define that macro instead of using -Wsystem-headers. Could you see if that works?