Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2018 18:25:44 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        Bruce Evans <bde@freebsd.org>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r335053 - in head/sys: compat/freebsd32 compat/linux fs/nfsclient kern sys
Message-ID:  <20180614181525.I1417@besplex.bde.org>
In-Reply-To: <90566a73-c793-2cc4-27ac-039bf83fd2d0@selasky.org>
References:  <201806131222.w5DCM00c001080@repo.freebsd.org> <90566a73-c793-2cc4-27ac-039bf83fd2d0@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 14 Jun 2018, Hans Petter Selasky wrote:

> On 06/13/18 14:22, Bruce Evans wrote:
>> [... inlines for makedev(), etc.]
>
> Can you use all macros here? This breaks OFED, because __makedev() is used to 
> initialize variables.

See another reply.

I will change them to macros and fear breaking them with a gccism instead
of with with inlines.

I should have worried more about the inlines.  Plain inline is only in C99
or a gcc extension starting in gcc-2.mumble.  Portability of sys/types.h is
more important than for any other header in the system except sys/cdevs.h.
So it must compile with C90 compilers and should compile with K&R compilers.
For makedev(), etc., it spells inline as __inline so the inline feature
can be turned off easily (the functions then become static and repeated
every time sys/types.h is included, but this probably happens anyway with
-O0 and it works for any compiler).

Turning off the statement-expression feature needed to write safe
macros is not so easy.  In <sys>, this feature is only used in
mostly-kernel headers and in stdatomic.h.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180614181525.I1417>