svn commit: r350902 - head/sys/powerpc/include

Leandro Lupori luporl at FreeBSD.org
Mon Aug 12 17:18:21 UTC 2019


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__


More information about the svn-src-all mailing list