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.133.124]) by sourceware.org (Postfix) with ESMTPS id CCA3D3858D1E for ; Mon, 30 Jan 2023 12:43:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CCA3D3858D1E 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=1675082613; 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=h2XKW+hpmhkANi7S4GcCI5UHmEYn+ORtM8cXcDKxhVY=; b=QWqZdBF64vdJxyHaord7J/DpPtCnsRRpj1IhVja/5IJuPFu1Ff9B331dEKvyQwDK3q/kt7 keQ1s/f1o0h5saD5VNsS0xK2Gh8kXoPqWYX+Q6Cgrxz1akRPmtBpqw/6gHUrJucnHsgoD7 L0StSwPzRp80qkK4QPgz7ThoU1BXbhs= 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-530-Tr9zt0W6PGqQqSYIY3lTCQ-1; Mon, 30 Jan 2023 07:43:32 -0500 X-MC-Unique: Tr9zt0W6PGqQqSYIY3lTCQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 105CF857F40 for ; Mon, 30 Jan 2023 12:43:32 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 817B24010D2A; Mon, 30 Jan 2023 12:43:31 +0000 (UTC) From: Florian Weimer To: Siddhesh Poyarekar Cc: libc-alpha@sourceware.org Subject: Re: C90 header compatibility References: <871qnc1mjo.fsf@oldenburg.str.redhat.com> Date: Mon, 30 Jan 2023 13:43:30 +0100 In-Reply-To: (Siddhesh Poyarekar's message of "Mon, 30 Jan 2023 07:26:34 -0500") Message-ID: <87v8koxkel.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.6 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_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: * Siddhesh Poyarekar: > On Mon, Jan 30, 2023 at 2:58 AM Florian Weimer wrote= : >> >> We regressed compatibility with C90 compilers because >> unconditionally uses variadic macros, a C99 feature, in the definition >> of __glibc_fortify and __glibc_fortify_n. >> >> This also impacts certain C++ compilers that do not have a >> C99-compatible preprocessor. >> >> Should we fix this? I think so. >> >> Previously, we worked around this by enclosing variable-length lists in >> (=E2=80=A6), but it doesn't look like it might work here. We probably n= eed to >> move the macros into a separate file, and include that file only if >> fortification is active. > > Wouldn't conditionalizing the macro defs in-place with #if > __FORTIFY_LEVEL > 0 sufficient? __FORTIFY_LEVEL can be non-zero only > for gcc 4.1 or newer. That is, do these older compilers complain if > there's code they cannot recognize in a #if 0 block? =E2=80=9C#if=E2=80=9D should work, based on a few quick tests. Thanks, Florian