Date: Mon, 12 Aug 2019 17:18:21 +0000 (UTC) From: Leandro Lupori <luporl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350902 - head/sys/powerpc/include Message-ID: <201908121718.x7CHILGN003640@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luporl Date: Mon Aug 12 17:18:20 2019 New Revision: 350902 URL: https://svnweb.freebsd.org/changeset/base/350902 Log: [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 Modified: head/sys/powerpc/include/proc.h Modified: head/sys/powerpc/include/proc.h ============================================================================== --- head/sys/powerpc/include/proc.h Mon Aug 12 15:54:30 2019 (r350901) +++ head/sys/powerpc/include/proc.h Mon Aug 12 17:18:20 2019 (r350902) @@ -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__
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908121718.x7CHILGN003640>