Skip to content

Commit 124c3b4

Browse files
committed
Add more description for zero-length array of empty structs/union
1 parent 3fc8030 commit 124c3b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

riscv-cc.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ treats it as a non-empty field since {Cpp} defines the size of an empty struct
241241
or union as 1. However, C defines it as 0, that result from the array with an
242242
empty struct or union having a different size between C and {Cpp}. i.e.
243243
`struct { struct {} e[1]; float f; };` C will passed by `f0`, but {Cpp} will
244-
passed by `a0`
244+
passed by `a0`, because `e` will be ignored in C but in for {Cpp};
245+
The zero-length array of empty structs or union will treat be
246+
ignored for bot C and {Cpp}. i.e. For `struct { struct {} e[0]; float f; };`,
247+
C and {Cpp} will passed by `f0` since `e` will be ignored in both C and {Cpp}.
245248

246249
A real floating-point argument is passed in a floating-point argument
247250
register if it is no more than ABI_FLEN bits wide and at least one floating-point

0 commit comments

Comments
 (0)