Skip to content

Commit

Permalink
Specify the alignment and size for array
Browse files Browse the repository at this point in the history
After I reviewing the calling convention part, I found we missed the
alignment and size for array, fortunately it's both open source
compilers are implement the same, so just document that down.
  • Loading branch information
kito-cheng committed Nov 12, 2023
1 parent d1743f6 commit eee666d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions riscv-cc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,14 @@ The alignment of `max_align_t` is 16.
Structs and unions are aligned to the alignment of their most strictly aligned
member. The size of any object is a multiple of its alignment.

=== Array

The alignment requirement for an array shall be equivalent to the alignment
requirement of its elemental type.

The size of an array is determined by multiplying the size of its
elemental type by the total number of elements within the array.

=== C/{Cpp} type representations

`char` is unsigned.
Expand Down

0 comments on commit eee666d

Please sign in to comment.