The header <lib/libkern/libkern.h> defines two sets of assert macros, one for standard C and another for the traditional cpp. As the header requires the use of a C compiler (that is, no inclusion from an assembly file), it looks that the non-__STDC__ parts could be removed.
OK? Index: lib/libkern/libkern.h =================================================================== RCS file: src/sys/lib/libkern/libkern.h,v retrieving revision 1.35 diff -u -p -r1.35 libkern.h --- lib/libkern/libkern.h 25 Apr 2018 11:15:58 -0000 1.35 +++ lib/libkern/libkern.h 8 Feb 2020 16:41:00 -0000 @@ -105,13 +105,8 @@ abs(int j) #ifdef NDEBUG /* tradition! */ #define assert(e) ((void)0) #else -#ifdef __STDC__ #define assert(e) ((e) ? (void)0 : \ __assert("", __FILE__, __LINE__, #e)) -#else -#define assert(e) ((e) ? (void)0 : \ - __assert("", __FILE__, __LINE__, "e")) -#endif #endif #define __KASSERTSTR "kernel %sassertion \"%s\" failed: file \"%s\", line %d" @@ -120,38 +115,22 @@ abs(int j) #define KASSERTMSG(e, msg, ...) ((void)0) #define KASSERT(e) ((void)0) #else -#ifdef __STDC__ #define KASSERTMSG(e, msg, ...) ((e) ? (void)0 : \ panic(__KASSERTSTR " " msg, "diagnostic ", #e, \ __FILE__, __LINE__, ## __VA_ARGS__)) #define KASSERT(e) ((e) ? (void)0 : \ __assert("diagnostic ", __FILE__, __LINE__, #e)) -#else -#define KASSERTMSG(e, msg, ...) ((e) ? (void)0 : \ - panic(__KASSERTSTR " " msg, "diagnostic ", "e", \ - __FILE__, __LINE__, ## __VA_ARGS__)) -#define KASSERT(e) ((e) ? (void)0 : \ - __assert("diagnostic ", __FILE__, __LINE__, "e")) -#endif #endif #ifndef DEBUG #define KDASSERTMSG(e, msg, ...) ((void)0) #define KDASSERT(e) ((void)0) #else -#ifdef __STDC__ #define KDASSERTMSG(e, msg, ...) ((e) ? (void)0 : \ panic(__KASSERTSTR " " msg, "debugging ", #e, \ __FILE__, __LINE__, ## __VA_ARGS__)) #define KDASSERT(e) ((e) ? (void)0 : \ __assert("debugging ", __FILE__, __LINE__, #e)) -#else -#define KDASSERTMSG(e, msg, ...) ((e) ? (void)0 : \ - panic(__KASSERTSTR " " msg, "debugging ", "e", \ - __FILE__, __LINE__, ## __VA_ARGS__)) -#define KDASSERT(e) ((e) ? (void)0 : \ - __assert("debugging ", __FILE__, __LINE__, "e")) -#endif #endif #define CTASSERT(x) extern char _ctassert[(x) ? 1 : -1 ] \