svn commit: r352661 - head/sys/netinet/tcp_stacks

Bruce Evans brde at optusnet.com.au
Tue Sep 24 21:38:57 UTC 2019


On Tue, 24 Sep 2019, Randall Stewart wrote:

> Log:
>  lets put (void) in a couple of functions to keep older platforms that
>  are stuck with gcc happy (ppc). The changes are needed in both bbr and
>  rack.

You mean "Don't use K&R declarations.  clang is too broken to warn about
K&R declarations even when requested to do so using -Wstrict-prototypes,
but some archss (e.g., ppc) haven't been downgraded to use clang yet,
so K&R declarations in kernel code are still detected in FreeBSD eventually.

WERROR was recently broken for gcc-4.2 by making warnings not fatal, so
the changes are not strictly needed.  I use gcc-4.2 on x86 for all except
about 10 files with ifuncs, and the broken WERROR causes serious problems:
gcc-4.2 doesn't support ifuncs, so I have to downgrade to clang to compile
files with ifuncs.  ifuncs only generate warnings and this used to be fatal,
so files ifuncs were easy to find.  Now, garbage object files are created
and the errors are obscure linkage errors.

Of course, I fix this by restoring WERROR=-Werror.  This clearly shows the
bitrot that tcp_lro.c doesn't compile.  It has casts of pointers uint64_t
instead of to uintptr_t.  On i386, these types have different sizes, so
gcc detects the type mismatch.  clang is too broken to report this type
mismatch.  The upcast happens to be safe on x86 but gcc's warning is good
for portability (source portability to compilers that detect the type
mismatch in some way, and binary portabiily to future arches with pointers
larger than uint64_t).

Bruce


More information about the svn-src-head mailing list