[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/sys
> Date: Sun, 30 Apr 2023 07:27:34 +0700
> From: Robert Elz <kre%munnari.OZ.AU@localhost>
> Date: Sat, 29 Apr 2023 23:30:18 +0000
> From: "Robert Elz" <kre%netbsd.org@localhost>
> Message-ID: <20230429233018.CADF4FA87%cvs.NetBSD.org@localhost>
> | Modified Files:
> | src/sys/kern: vfs_subr.c
> | src/sys/sys: sdt.h
> | Log Message:
> | Fix builds (hopefully) when DTRACE hooks are not included.
> Feel free to revert this and fix things in a better way.
Thanks, sorry for the breakage -- had verified a kernel build but not
a full distribution build including rump.
I'm working on a better fix that doesn't require extra conditionals or
declarations like this or compile-testing both ways: make SDT_PROBE*
and DTRACE_PROBE* type-check their arguments, but not evaluate them,
in builds without KDTRACE_HOOKS.
I was hoping I could find a way to repurpose __USE(x) for this, by
making it expand to (void)sizeof(x) instead of (void)(x) so it
prevents side effects too.
That doesn't work for bit fields, though, which is why KASSERT does
(void)sizeof((long)(x)). But the cast to long doesn't work for
aggregate types, which the i915 code relies on, so we can't just
redefine __USE to do (void)sizeof((long)(x)).
For now I'll add a new __MACROUSE that handles bit fields but not
aggregates (since aggregates are not often passed as arguments), but
it'd be nice if someone figured out a way to unify them so they work
to type-check but suppress evaluation of all expression types, bit
fields and aggregates included.
Main Index |
Thread Index |