From nobody Mon Nov 20 16:01:09 2023 X-Original-To: freebsd-arch@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 4SYsgY3KcFz51TZ5 for ; Mon, 20 Nov 2023 16:01:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SYsgY1QQSz4VQw for ; Mon, 20 Nov 2023 16:01:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id 4jLLrAECMB0n056hzrtx5V; Mon, 20 Nov 2023 16:01:11 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 56hyrvNApU5YW56hzr6JiE; Mon, 20 Nov 2023 16:01:11 +0000 X-Authority-Analysis: v=2.4 cv=CZQbWZnl c=1 sm=1 tr=0 ts=655b82c7 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=BNY50KLci1gA:10 a=7Qk2ozbKAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=MveOevlX2-Qt8mWo66QA:9 a=CjuIK1q_8ugA:10 a=1lyxoWkJIXJV6VJUPhuM:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 41EA15EC; Mon, 20 Nov 2023 08:01:10 -0800 (PST) Received: from slippy (localhost [IPv6:::1]) by slippy.cwsent.com (Postfix) with ESMTP id CEBBB1E3; Mon, 20 Nov 2023 08:01:09 -0800 (PST) Date: Mon, 20 Nov 2023 08:01:09 -0800 From: Cy Schubert To: Warner Losh Cc: "freebsd-arch@freebsd.org" Subject: Re: Some K&R support to be removed from sys/cdefs.h Message-ID: <20231120080109.34bb47d6@slippy> In-Reply-To: References: Organization: KOMQUATS X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Discussion related to FreeBSD architecture List-Archive: https://lists.freebsd.org/archives/freebsd-arch List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arch@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfFMOeK6UtWXGJ/kW1hBWYRFsvtyZJRKCWDCOJ0ZGJfGk9H2olRuFAWEMYJIvnAm1EdZ+QM1N6eOZvely/o+t0Mc96oAo64VFiUSv/sBIPyCUhHJgm2ze HEjRIGAia0oBwFvOw6hj6wMkY4YmcN0B3iN1aCHqut4OObmqTjRlOwymG1vC7SrvIS6JxpQdew5xrrSuP10/qlm5pxAMfdm2mhmrkFNiIooSAodxKzl4IHS9 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4SYsgY1QQSz4VQw On Sun, 19 Nov 2023 20:44:49 -0700 Warner Losh wrote: > Greetings, > > I've had a long-term background project of cleaning up cdefs.h. So far it's > all been things that are definitely unused. My next target are some > specialized macros used to share code between K&R and ANSI-C compilers. K&R > support in general will remain unchanged by this (any code using these > macros that wants to continue will need to arrange for that in their build > system). It may surprise many to learn with about 30 flags on the command > line, one can compile unmodified code from the 80s that conforms to the V7 > K&R language spec (for some not terrible definition of conforms to a > squishy spec). > > The support I'm talking about is __P, __CONCAT, __STRING, defining __const, > __inline, __signed and __volatile to nothing (only on some compilers) and > sometimes defining const, inlined, signed and volatile to nothing when > building when __STDC__ is not defined. This support was a transition from a > time, predating the FreeBSD project for the most part, when numerous > programs were specially curated so they could build on K&R compilers as > well as the then newly emergent ANSI-C compilers that were appearing. The > need to do this has long since past, so I'll be removing the pre-ansi-c > build environment support for doing this specific thing. > > I'll retain __P, __const, __signed and __volatile in __STDC__ environments, > but have firm plans to remove them completely in a future round. I've > already removed all __P usage from the tree (except sendmail). The others > have a smattering of long-dead-hand-of-the-past usage in the tree (in libm, > for example). I plan on leaving __inline unchanged because it has a > secondary meaning. I suspect the only wide-spread one that will cause me > grief is __P. All the others I see occasionally, but it's not pervasive > like __P once was (and still is in older projects, shocking at that may be). > > I have no plans on eliminating __CONCAT or __STRING. Their use is > widespread in the tree is extensive, and where they are used, it's fine. > There's no need to gratuitously churn things here. To the extent that pure > K&R compilers are including our system headers, this will represent one > more tiny step away from supporting that (as they are used in our headers). > But such environments need their own headers anyway: all our headers use > ANSI-C prototypes w/o __P protection. > > As with all my cdefs cleanups, I'll do exp runs before I commit. For the > more consequential ones, I plan on posting reviews. For the other myriad of > completely unused and designed to tell gcc3 from gcc4 or gcc2 from gcc3, > I'm just going to eliminate those.There's no point in keeping them once I > make sure nothing in ports uses them. > > I suspect nobody will care, except to cheer on the removal of > no-longer-needed junk that makes cdefs.h hard to read. My timeline for this > and other cleanup of cdefs.h is 'before 15 branches'. > > Comments? Suggestions? > > Warner Would we need an exp-run to find ports that might need some attention? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0