Changeset c4e3419c
- Timestamp:
- Feb 15, 2021, 1:52:46 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 79debb02
- Parents:
- 17d6214
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/user.tex
r17d6214 rc4e3419c 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Feb 15 09:54:33 202114 %% Update Count : 44 4213 %% Last Modified On : Mon Feb 15 13:48:53 2021 14 %% Update Count : 4452 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 1247 1247 \begin{cfa} 1248 1248 struct Person { $\C{// aggregate}$ 1249 struct Name { $\C{// nesting}$ 1250 char first[20], last[20]; 1251 } name; 1252 struct Address { $\C{// nesting}$ 1253 ... 1254 } address; 1249 struct Name { char first[20], last[20]; } name $\C{// nesting}$ 1250 struct Address { ... } address $\C{// nesting}$ 1255 1251 int sex; 1256 1252 }; … … 1271 1267 1272 1268 C allows unnamed nested aggregates that open their scope into the containing aggregate. 1273 However, this feature is only useful for©union© aggregates.1269 This feature is used to group fields for attributes and/or with ©union© aggregates. 1274 1270 \begin{cfa} 1275 1271 struct S { 1272 struct { int g, h; } __attribute__(( aligned(64) )); 1273 int tag; 1276 1274 union { 1277 char @c@; int @i@; double @d@; 1275 struct { char c1, c2; } __attribute__(( aligned(128) )); 1276 struct { int i1, i2; }; 1277 struct { double d1, d2; }; 1278 1278 }; 1279 int tag; 1280 } s; 1281 @s@.tag; @s@.c; @s@.i; @s@.d; $\C{// no nested qualification for union fields}$ 1279 }; 1280 s.g; s.h; s.tag; s.c1; s.c2; s.i1; s.i2; s.d1; s.d2; 1282 1281 \end{cfa} 1283 1282
Note: See TracChangeset
for help on using the changeset viewer.