From a7d040cb73a6f3afb0620cab8ed1ea291df3b459 Mon Sep 17 00:00:00 2001 From: Donough Liu Date: Fri, 13 Mar 2020 19:27:10 +0800 Subject: [PATCH] Size fo empty structs in C is zero byte. --- src/type-layout.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/type-layout.md b/src/type-layout.md index 51ba859ef..003a3ce63 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -236,8 +236,9 @@ the sake of clarity. To perform memory layout computations in actual code, use -> Note: This algorithm can produce zero-sized structs. This differs from -> C where structs without data still have a size of one byte. +> Note: This algorithm can produce zero-sized structs. In C, the size of +> structs without data is zero. This is not the same as C++ where structs +> without data still have a size of one byte. #### \#[repr(C)] Unions