From nobody Tue Jul 02 18:27:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WDBGt2NV9z5P02B; Tue, 02 Jul 2024 18:27:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDBGt1RJxz4Wdw; Tue, 2 Jul 2024 18:27:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719944870; 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=GB/JDL0ijvdqWDw3X6ScZ6lDiUpZw96p2vXHDaCsSwU=; b=ebLIo2ruFFwqjbCzwIYZnonJTuwxcKxfiZ5P3B4HbPUZN45juKogh/qyG6m5GvuRqzNYLT LBHVd0DtxX2tNjOeTqwCmVLLFJA1k3Oq26NTGj4bBmBRcMkJaCOtCMqxKBun/LrJYOtjtD BlcazCXeCXTM1Db0evoeEElombsZV5701o5Y5xyqT3iTZ5awIfBFhCiWeAE8JPIkQDmKf7 wd3VPsu7toMWVFpqTNlg6Apw/F/1ks187e41pMrwHUWADgPy4BXkBqYZkc0LlwzoYeX99E AnVRCTMB+Bbg7opBOVh2q0i/ICHyfQScNe6KVPQwKIlCmihA/vJ9VL4CjkNIoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719944870; a=rsa-sha256; cv=none; b=jkPgpm1p3qklwHNsw/3ECJrevFoRgFb+oC/xPPP6xsIHvV5SRbo4WtvskrvveJCirvojRx 4gHOO3Ldo702T3cXfrBMUdZJkOUKG1aEgOw/dXklUYi4ATp0R0rKK12K3rFoetM6kUQkrE ejion5uUdtKu6Q/nEDcD7+JNamDzUvfD0Tpi7GF/7CQwowE9XI/j4+k9QIfuplTgagWesG i3JFe5zHx5X093hxOH0K1m82igGYSImoXv9gYUfU0Hc1cZZIqJoJ0KLOFhn10wtiEYGsMU yt+ZH2J4oS9pKPpyzEESOGdQZf2EYURcq+Cd9tP0aXxfkBamp/FQriOJ2/3KSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719944870; 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=GB/JDL0ijvdqWDw3X6ScZ6lDiUpZw96p2vXHDaCsSwU=; b=P3wAY04hdUPeykvbf0TUJXLtHYDL6izN+Z72Z3DWs6lfC6U+PT4UUTjiPYkeRxzONtAHY3 wJKj4ELauamsiqflUVgmjO4++7PAOOjwBOmEfKaojbzFNU0cOIRPTwC39xrdrud9hoPqQf Pa1X+5cpTW/YQUDQV+RPA0Yapgu5e+1Jmaj9xrWNTyN3Lr+f/dxBf0U//6ou9FILImyePV EkqLyVdNGRsStGDg90OdGBqSM8IS5InUqCrd1+7aonR+0hi7dtEgVZnpfEfqIrff57i8lo NlGjTlvZD7pZ0/WBFIEOB6gokmroxryfSgW2L7qiAwXwHA0YtQxRQe9iwS3aSQ== Received: from [IPV6:2601:5c0:4200:b830:3517:62a3:b646:39a7] (unknown [IPv6:2601:5c0:4200:b830:3517:62a3:b646:39a7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WDBGs5ltZz19hL; Tue, 2 Jul 2024 18:27:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <3e59b5b4-5807-49bd-a069-642f321c9662@FreeBSD.org> Date: Tue, 2 Jul 2024 14:27:48 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 67d1a1cd9e77 - main - cdefs.h: Remove support for pre gcc 4.0 Content-Language: en-US To: Warner Losh Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/2/24 12:30, Warner Losh wrote: > Hey John, > > On Tue, Jul 2, 2024 at 9:44 AM John Baldwin wrote: > >> On 7/1/24 4:09 PM, Warner Losh wrote: >>> On Mon, Jul 1, 2024, 3:53 PM John Baldwin wrote: >>> >>>> On 6/20/24 7:41 PM, Warner Losh wrote: >>>>> The branch main has been updated by imp: >>>>> >>>>> URL: >>>> >> https://cgit.FreeBSD.org/src/commit/?id=67d1a1cd9e772e2ef94003579f4fbc271d38be7d >>>>> >>>>> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d >>>>> Author: Warner Losh >>>>> AuthorDate: 2024-06-20 23:02:56 +0000 >>>>> Commit: Warner Losh >>>>> CommitDate: 2024-06-21 02:41:08 +0000 >>>>> >>>>> cdefs.h: Remove support for pre gcc 4.0 >>>>> >>>>> All supported compilers support the gcc 3 attribute extensions. >>>> Remove >>>>> the #else clauses for this. Also, latter-day pcc compilers also >>>> define >>>>> __GNUC__, so there's not need to also test for __PCC__. >>>>> >>>>> Reviewed by: brooks >>>>> Differential Revision: https://reviews.freebsd.org/D45654 >>>>> Sponsored by: Netflix >>>>> --- >>>>> sys/sys/cdefs.h | 42 ++++-------------------------------------- >>>>> 1 file changed, 4 insertions(+), 38 deletions(-) >>>>> >>>>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h >>>>> index 88019819eb35..a6ecdca5d8b9 100644 >>>>> --- a/sys/sys/cdefs.h >>>>> +++ b/sys/sys/cdefs.h >>>>> @@ -408,15 +389,10 @@ >>>>> * assign pointer x to a local variable, to check that its type is >>>>> * compatible with member m. >>>>> */ >>>>> -#if __GNUC_PREREQ__(3, 1) >>>>> #define __containerof(x, s, m) ({ >>>> \ >>>>> const volatile __typeof(((s *)0)->m) *__x = (x); >> \ >>>>> __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, >> m));\ >>>>> }) >>>>> -#else >>>>> -#define __containerof(x, s, m) >>>> \ >>>>> - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) >>>>> -#endif >>>>> >>>>> /* >>>>> * Compiler-dependent macros to declare that functions take >> printf-like >>>>> @@ -434,14 +410,8 @@ >>>>> #define __strftimelike(fmtarg, firstvararg) \ >>>>> __attribute__((__format__ (__strftime__, fmtarg, >> firstvararg))) >>>>> >>>>> -/* Compiler-dependent macros that rely on FreeBSD-specific extensions. >>>> */ >>>>> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 >> && \ >>>>> - defined(__GNUC__) >>>>> #define __printf0like(fmtarg, firstvararg) \ >>>>> __attribute__((__format__ (__printf0__, fmtarg, >> firstvararg))) >>>>> -#else >>>>> -#define __printf0like(fmtarg, firstvararg) >>>>> -#endif >>>> >>>> Does this still work with external GCC? I didn't think printf0 was >>>> supported >>>> by external GCC (or maybe I had to readd it in the port and that's what >> I >>>> remember). Ah, yes, printf0 is a local patch in the devel/freebsd-gccX >>>> ports, but is not available in stock GCC (e.g. lang/gcc does not support >>>> it). >>>> >>> >>> Ah. That would explain why it just worked for me. That's what I tested >>> with. Clang also seemed happy with it. But that was the in tree clang. Is >>> there a similar issue? Gnuc is defined for both. >> >> So we don't support building the base system with lang/gcc, only >> devel/freebsd-gccX (which has a local patch to add printf0 support). >> The only question might be, do we support using __printf0like for things >> that aren't in the base system that could be built with lang/gcc. If so, >> we might need to guard this somehow. I'm not sure though that we care >> about random software not in base using a FreeBSD-specific keyword from >> . >> > > Yes. The question is "do we use __printf0like in our headers" since we > definitely > can't build FreeBSD itself w/o at least some of the extensions for other > things... > and the answer is "yes". err.h uses it, for example, as does setproctitle > in stdlib.h > > The interesting thing for me is that gcc13 will produce no warnings if I > include errr.h > because -Wsystem-header is off. With it on, warnings crop up too. This is > why my testing > didn't see it... > > It looks like clang has it as a builtin for all versions we care about, so > I'll create a phab to add some > of this back. Maybe we should upstream what we have, for this and > freebsd_printf since that's also > in clang and one of the small number of patches we have for the lang/gcc* > family? Yeah, I should do my FSF paperwork for GCC sometime and try to upstream at least the printf changes and a few others (i386 defaulting to i686 on recent releases as well) -- John Baldwin