Ignore:
Timestamp:
Aug 8, 2024, 10:02:34 PM (2 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
7568e5c
Parents:
11cced6
git-author:
Peter A. Buhr <pabuhr@…> (08/08/24 22:01:56)
git-committer:
Peter A. Buhr <pabuhr@…> (08/08/24 22:02:34)
Message:

last proofread of thesis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/jiada_liang_MMath/Cenum.tex

    r11cced6 rc1c0efdb  
    1515enum E2 { @Fourth@, @Third@, @Second@, @First@ }; $\C{// same enumerator names}$
    1616\end{cfa}
    17 There is no mechanism in C to resolve these naming conflicts other than renaming one of the duplicates, which may be impossible if the conflict comes from system-include files.
     17There is no mechanism in C to resolve these naming conflicts other than renaming one of the duplicates, which may be impossible if the conflict comes from system include-files.
    1818
    1919The \CFA type-system allows extensive overloading, including enumerators.
    2020Hence, most ambiguities among C enumerators are implicitly resolved by the \CFA type system, possibly without any programmer knowledge of the conflict.
    21 In addition, C Enum qualification is added, exactly like aggregate field qualification, to disambiguate.
     21In addition, C Enum qualification is added, exactly like aggregate field-qualification, to disambiguate.
    2222\VRef[Figure]{f:EnumeratorVisibility} shows how resolution, qualification, and casting are used to disambiguate situations for enumerations @E1@ and @E2@.
    2323
     
    6868
    6969\section{Type Safety}
     70\label{s:TypeSafety}
    7071
    7172As in Section~\ref{s:Usage}, C's implicit bidirectional conversion between enumeration and integral type raises a safety concern.
     
    101102\item[How widely used:] Common.
    102103\end{description}
    103 
    104 \begin{comment}
    105 \begin{description}[parsep=0pt]
    106 \item[Change:] In \CC, the type of an enumerator is its enumeration.
    107 In C, the type of an enumerator is @int@.
    108 Example:
    109 \begin{cfa}
    110 enum e { A };
    111 sizeof(A) == sizeof(int)        $\C{// in C}$
    112 sizeof(A) == sizeof(e)          $\C{// in \CC}$
    113 /* and sizeof(int) is not necessary equal to sizeof(e) */
    114 \end{cfa}
    115 \item[Rationale:] In \CC, an enumeration is a distinct type.
    116 \item[Effect on original feature:] Change to semantics of well-defined feature.
    117 \item[Difficulty of converting:] Semantic transformation.
    118 \item[How widely used:] Seldom. The only time this affects existing C code is when the size of an enumerator is
    119 taken. Taking the size of an enumerator is not a common C coding practice.
    120 \end{description}
    121 \end{comment}
Note: See TracChangeset for help on using the changeset viewer.