From nobody Tue Jul 2 15:44:03 2024 X-Original-To: dev-commits-src-main@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 4WD6dw1pTKz5Mpvg; Tue, 02 Jul 2024 15:44:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4WD6dw0jZhz467y; Tue, 2 Jul 2024 15:44:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719935044; 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=uL7FQ0+3neBxfvvH42RLULhnXOO3GkUdzEnWnfBfIh4=; b=jnZsiWS816ECMK8FMziKK27+D8C2oOmBMo0llPiEVz4P+pgeLyWUKVW42LR2UCCHyZNtji tj+pZ0cs3Jikpf/9m8CqeNQZRZXWHKAOOHU+uwBy9Oi6RhC7F0d1AkWr9P3NmSxxoKvvVk uFGlOar1O1pzhp3c3wUoms9r99vfKPBcPmRHG47duMGCwJaoCySLUkVVkbO/nlf2x9rsuD JqtA0E1ycnKQzXy5Z8Tp6CtT+bSd2TTi8WE/lw4GiqBr0c2Dlhz5uRZaPRfSVhu5Yvt/AJ 4GCNhqWIZNQGuQXZJMKlWUWbp0Iw3Mr9NAW3REzOBYuZ//TN0J0zOJ7ucGryIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719935044; a=rsa-sha256; cv=none; b=qFVlGhZsjjGXR1aKqkuF4txWlgAgIZcQLFeTYqp+gV4TvubRbdzNLbZ4eWc4/IzrIJQUhG R0Ljtfdw6aLQq2tuMYhnbNFC7PLjaQi6urLVe9h76fZ2vvLfjebUEWYc3gMSzemx3mZCbk V89vfDrUo4mOqRm948eE072+9c2OhqTDLElw3HDDCnNDdbFwwahtjWsYyHeMW/cxTj2+kB /XWXQUBPOpWQjiI61u3ku6G2qq2H/xMdVw+eZbKOrpU68obX1l82TNhWzTLBwHgoAWJn0s WTcscuoa3g0xL766YJuzptjdy46YmfjWb+Tg8L8JDwd0Ch3BK4tH47zoGuYONg== 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=1719935044; 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=uL7FQ0+3neBxfvvH42RLULhnXOO3GkUdzEnWnfBfIh4=; b=bxx/HIUNVV2S2KLZclLiNOkt+hOe2q9UdPVl2EiYEHqWxEF2za+m+/Ziel3q5BTXys3Txx kJh/9FlT+mbySGouzMQuNGVmm1ssrbM4fQ/hN2Av0LXvlgryLbV1nznXZk1L33vAUkrQbr G8jZ43wAuXjETMbc4BlM0I7GO4yDZzKof3maxp759IkE6jGC0X6PBhhD3V3ZHRadlXpoXd n6O0Dd6Bh7zyQoU1WoOR622Nc2wXJ2KkuEsZzTMdYNDjydVVc62/e7g3l5mLaN+0OsPxrg lC6ljxXWuMhCAYPQx+DnraV95ZrBUsZuHTT/A39aMG+koiZvRrQoGww4izk81w== 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 4WD6dv5VQwz17xh; Tue, 2 Jul 2024 15:44:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 2 Jul 2024 11:44:03 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/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 . -- John Baldwin