From nobody Wed Aug 13 18:06:44 2025 X-Original-To: freebsd-current@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 4c2GXl6hvPz64HGk for ; Wed, 13 Aug 2025 18:06:47 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4c2GXl3nCVz430p for ; Wed, 13 Aug 2025 18:06:47 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Authentication-Results: mx1.freebsd.org; none Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.18.1/8.18.1) with ESMTP id 57DI6iX2011582; Wed, 13 Aug 2025 11:06:44 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) DKIM-Filter: OpenDKIM Filter v2.10.3 troutmask.apl.washington.edu 57DI6iX2011582 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=troutmask.apl.washington.edu; s=troutmask; t=1755108404; bh=DaKJxZ//hPOdgdk6fvLnlPz9HGLP09QgJQZy+R47i5c=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=hrRWJFUylHm8OsJsnbNFeDzIHcZqo5XxYpSK+IMVrurAsJePoRjlc2A1koWJ/2/MV f5jbKuUsTvEeZbJGcMfZIavJL1n9ebNTjhjtHYttXJEbH2JTtz8QnL6NE8EwRPvxQY 42xgRGiREzMBKidvnu4l0S630CSZ9eUci9B/qXQ7XIqMKyoK6q6wZ5vPCJGAeIRC7b ox+xGq+xydTK+0kbip4js+euV9eU0J9GmXWPLYwpRqWfsw5ou0Gg7aydhLr49v6lDR Gv8TkttjlAmXO6XnNzcITHiwAwXMO0MY4u0OLap0aHaCzDJG5UuWb/u1IPtXo4ShU8 sRIeUX0TQWnyw== Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.18.1/8.18.1/Submit) id 57DI6ii2011581; Wed, 13 Aug 2025 11:06:44 -0700 (PDT) (envelope-from sgk) Date: Wed, 13 Aug 2025 11:06:44 -0700 From: Steve Kargl To: Warner Losh Cc: freebsd-current@freebsd.org Subject: Re: a question about style(9) and inline Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4c2GXl3nCVz430p 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:73, ipnet:128.95.0.0/16, country:US] On Wed, Aug 13, 2025 at 11:43:44AM -0600, Warner Losh wrote: > On Wed, Aug 13, 2025 at 11:32 AM Steve Kargl < > sgk@troutmask.apl.washington.edu> wrote: > > > In looking at lib/msun/math_private, one finds > > > > static __inline float complex > > static __inline double complex > > static __inline long double complex > > static inline double > > static inline float > > static inline long double > > static __inline int > > static __inline int > > static __inline int > > static inline int32_t > > static inline int32_t > > > > style(9) seems to not contain any preference with respect > > to __inline versus inline. As a matter of consistency, > > I would like to use whatever is the preferred keyword. > > So, which should be used. > > > > We generally have static __inline, though the reasons for that are > historical. We originally did it to support building FreeBSD with a K&R > compiler. Now, we've narrowed the scope of K&R support so we only really > require it for public files since we support K&R compilers that are like > how gcc implemented this (which basically is to have ansi keywords in the > identifier space). In that environment, __inline is an extension. In C > code, this is just a compiler extension meaning the same thing as inline. > For C++ mode, we redefine __inline to inline. And we have some vestigial > support for doing the same for the C compiler that doesn't support __inline. > > However, I did a bit of a survey just now, and more recently we've given up > on that and just use a raw inline by and large. With __inline being a > legacy item. > > In this context, though, math_private.h isn't public, so I'd just use > inline. It's ancient enough that the old-school considerations mandated > __inline (not least because bde favored building with such compilers). Now, > I don't think it matters anymore, and we should just use the standard way > of doing it. Thanks for the input. inline is in n869.pdf (working draft of C99) with 01/18/99 date. It is likely safe to assume that today C compilers used to compile FreeBSD support inline. I'll get to submitting a patch to cleanup __inline in math_private.h (eventually). -- Steve