Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/omc/tests/layout/sizes.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / omc / tests / layout / sizes.om` 47 lines ยท 610 bytes Raw Blame History 1 note sizeof and offsetof are compile-time constants of type ulong; struct fields live in 8-byte cells. 2 struct S a uchar b ulong c uchar 3 end 3 fn main to int 4 if ne sizeof bool 1 5 ret 1 6 end 7 if ne sizeof uchar 1 8 ret 2 9 end 10 if ne sizeof ushort 2 11 ret 3 12 end 13 if ne sizeof uint 4 14 ret 4 15 end 16 if ne sizeof ulong 8 17 ret 5 18 end 19 if ne sizeof int 4 20 ret 6 21 end 22 if ne sizeof long 8 23 ret 7 24 end 25 if ne sizeof f32 4 26 ret 8 27 end 28 if ne sizeof f64 8 29 ret 9 30 end 31 if ne sizeof S 40 32 ret 10 33 end 34 if ne offsetof S a 0 35 ret 11 36 end 37 if ne offsetof S b 8 38 ret 12 39 end 40 if ne offsetof S c 16 41 ret 13 42 end 43 if ne add sizeof S offsetof S b 48 44 ret 14 45 end 46 ret 0 47 end