From d412969e8961d262553866a9c38006ad5df05012 Mon Sep 17 00:00:00 2001 From: luporl Date: Mon, 12 Aug 2019 17:18:20 +0000 Subject: [PATCH] [ppc] avoid empty mdproc struct Avoid empty structs, that have undefined behavior in C99 and make compilers complain about it (empty struct has size 0 in C, size 1 in C++). Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21231 --- sys/powerpc/include/proc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/powerpc/include/proc.h b/sys/powerpc/include/proc.h index d01b6cda4dcd..dcb30e1dbb0f 100644 --- a/sys/powerpc/include/proc.h +++ b/sys/powerpc/include/proc.h @@ -46,6 +46,11 @@ struct mdthread { }; struct mdproc { + /* Avoid empty structs, that have undefined behavior in C99 and + * make compilers complain about it + * (empty struct has size 0 in C, size 1 in C++). + */ + long md_spare; }; #ifdef __powerpc64__