Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: POINTER_ALIGNED_P (was: Re: CVS commit: src/sys)



On 16.02.2021 23:32, Jason Thorpe wrote:

On Feb 16, 2021, at 1:56 PM, Roland Illig <roland.illig%gmx.de@localhost> wrote:

A downside of this test is that the macro from <sys/param.h> gets only
evaluated at compile time of the test.  The test therefore cannot cover
future updates to <sys/param.h> without being reinstalled itself.  But
at least for the release builds, it ensures a correct definition.

You can make this get evaluated at run-time by passing in a non-constant argument.

I wanted to make the test even more flexible: react to the then-current
installed version of the macro in <sys/param.h>.  To do that, the test
would need to be compiled at runtime, requiring a C compiler on the
target machine, and I'm not sure that's a valid assumption.

And maybe that's something that shouldn't be done at all, updating the
system header without the corresponding test suite.  So it's probably
fine as it is now, notwithstanding the discussion about whether the
macro is needed at all in this prominent place.

It surprised me though that neither Google nor GitHub found the macro
name POINTER_ALIGNED_P anywhere outside the NetBSD repository.  I would
have expected this name to be already used by some projects, given that
it is so straight-forward.

Roland


Home | Main Index | Thread Index | Old Index