Changeset 0c88135 for doc/theses/jiada_liang_MMath/CFAenum.tex
- Timestamp:
- Sep 15, 2024, 12:25:59 PM (5 weeks ago)
- Branches:
- master
- Children:
- 68a7028
- Parents:
- 17fdf6f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/jiada_liang_MMath/CFAenum.tex
r17fdf6f r0c88135 145 145 \begin{cfa} 146 146 enum E { E1, E2, E3 }; 147 staticconst char * E_labels[3] = { "E1", "E2", "E3" };148 staticconst T E_values[3] = { t1, t2, t3 };147 const char * E_labels[3] = { "E1", "E2", "E3" }; 148 const T E_values[3] = { t1, t2, t3 }; 149 149 \end{cfa} 150 150 The generated C enumeration has enumerator values that match \CFA enumerator positions because of C's auto-initialization. … … 156 156 so these expressions remain unchanged by \CFA-cc. 157 157 Therefore, a \CFA enumeration variable has the same underlying representation as its generated C enumeration. 158 This semantics implies a \CFA enumeration variable does not use memory, that @posn@ can useits underlying representation, and the label and value arrays take little storage.158 This semantics implies a \CFA enumeration variable uses the same storages as a C enumeration variable that @posn@ can use as its underlying representation, and the label and value arrays take little storage. 159 159 It should be possible to eliminated the two arrays if unused, either by \CFA if local to a translation unit and unused, or by the linker if global but unreferenced. 160 160 Also, the label and value arrays are declared @static@ and initialized with constants, so the arrays are allocated in the @.data@ section and initialized before program execution.
Note: See TracChangeset
for help on using the changeset viewer.