From 7c5e3e1f8e4671b383865df0150b549e2445d170 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 21 Sep 2018 14:15:58 -0400 Subject: [PATCH] fixups --- doc/langref.html.in | 40 ++++++++++++++------- src/ir.cpp | 32 ++++++++++------- std/c/darwin.zig | 26 +++++++------- test/cases/sizeof_and_typeof.zig | 61 +++++++++++++++++++++----------- test/compile_errors.zig | 8 ++--- 5 files changed, 104 insertions(+), 63 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index ef37d657dc..f28c8d6cfa 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -1947,6 +1947,15 @@ test "linked list" { assert(list2.first.?.data == 1234); } {#code_end#} + {#header_open|packed struct#} +

{#syntax#}packed{#endsyntax#} structs have guaranteed in-memory layout.

+

TODO bit fields

+

TODO alignment

+

TODO endianness

+

TODO @bitOffsetOf and @byteOffsetOf

+

TODO mention how volatile loads and stores of bit packed fields could be more efficient when + done by hand instead of with packed struct

+ {#header_close#} {#header_open|struct Naming#}

Since all structs are anonymous, Zig infers the type name based on a few rules.