Index: doc/theses/jiada_liang_MMath/background.tex
===================================================================
--- doc/theses/jiada_liang_MMath/background.tex	(revision 736a38dedf9b0e28de1be78317e94889af77d502)
+++ doc/theses/jiada_liang_MMath/background.tex	(revision 10a99d87259c93fc17a6d7791c541fee72559acc)
@@ -6,5 +6,5 @@
 The following discussion covers C enumerations.
 
-As discussed in \VRef{s:Aliasing}, it is common for C programmers to ``believe'' there are three equivalent forms of named constants.
+As mentioned in \VRef{s:Aliasing}, it is common for C programmers to ``believe'' there are three equivalent forms of named constants.
 \begin{clang}
 #define Mon 0
@@ -33,6 +33,6 @@
 C can simulate the aliasing @const@ declarations \see{\VRef{s:Aliasing}}, with static and dynamic initialization.
 \begin{cquote}
-\begin{tabular}{@{}l@{}l@{}}
-\multicolumn{1}{@{}c@{}}{\textbf{static initialization}} &  \multicolumn{1}{c@{}}{\textbf{dynamic intialization}} \\
+\begin{tabular}{@{}ll@{}}
+\multicolumn{1}{@{}c}{\textbf{static initialization}} &  \multicolumn{1}{c@{}}{\textbf{dynamic intialization}} \\
 \begin{clang}
 static const int one = 0 + 1;
@@ -56,5 +56,5 @@
 \end{tabular}
 \end{cquote}
-However, statically initialized identifiers can not appear in constant-expression contexts, \eg @case@.
+However, statically initialized identifiers cannot appear in constant-expression contexts, \eg @case@.
 Dynamically initialized identifiers may appear in initialization and array dimensions in @g++@, which allows variable-sized arrays on the stack.
 Again, this form of aliasing is not an enumeration.
@@ -130,7 +130,30 @@
 
 \subsection{Implementation}
+\label{s:CenumImplementation}
 
 In theory, a C enumeration \emph{variable} is an implementation-defined integral type large enough to hold all enumerator values.
-In practice, C uses @int@ as the underlying type for enumeration variables, because of the restriction to integral constants, which have type @int@ (unless qualified with a size suffix).
+In practice, C defines @int@~\cite[\S~6.4.4.3]{C11} as the underlying type for enumeration variables, restricting initialization to integral constants, which have type @int@ (unless qualified with a size suffix).
+However, type @int@ is defined as:
+\begin{quote}
+A ``plain'' @int@ object has the natural size suggested by the architecture of the execution environment (large enough to contain any value in the range @INT_MIN@ to @INT_MAX@ as defined in the header @<limits.h>@).~\cite[\S~6.2.5(5)]{C11}
+\end{quote}
+Howeveer, @int@ means a 4 bytes on both 32/64-bit architectures, which does not seem like the ``natural'' size for a 64-bit architecture.
+Whereas, @long int@ means 4 bytes on a 32-bit and 8 bytes on 64-bit architectures, and @long long int@ means 8 bytes on both 32/64-bit architectures, where 64-bit operations are simulated on 32-bit architectures.
+In reality, both @gcc@ and @clang@ partially ignore this specification and type the integral size of an enumerator based its initialization.
+\begin{cfa}
+enum E { IMin = INT_MIN, IMax = INT_MAX,
+		 	 ILMin = LONG_MIN, ILMax = LONG_MAX,
+			 ILLMin = LLONG_MIN, ILLMax = LLONG_MAX };
+int main() {
+	printf( "%zd %d %d\n%zd %ld %ld\n%zd %ld %ld\n",
+			 sizeof(IMin), IMin, IMax,
+			 sizeof(ILMin), ILMin, ILMax,
+			 sizeof(ILLMin), ILLMin, ILLMax );
+}
+4 -2147483648 2147483647
+8 -9223372036854775808 9223372036854775807
+8 -9223372036854775808 9223372036854775807
+\end{cfa}
+Hence, initialization in the range @INT_MIN@..@INT_MAX@ is 4 bytes, and outside this range is 8 bytes.
 
 
@@ -151,10 +174,10 @@
 enum Week { Mon, Tue, Wed, Thu, Fri, Sat, Sun };
 switch ( week ) {
-	case Mon: case Tue: case Wed: case Thu: case Fri:
+	case Mon ... Fri:				$\C{// gcc case range}$
 		printf( "weekday\n" );
 	case Sat: case Sun:
 		printf( "weekend\n" );
 }
-for ( enum Week day = Mon; day <= Sun; day += 1 ) { // step of 1
+for ( enum Week day = Mon; day <= Sun; day += 1 ) { $\C{// step of 1}$
 	printf( "day %d\n", day ); // 0-6
 }
@@ -178,7 +201,7 @@
 }
 \end{cfa}
-However, for typed enumerations, \see{\VRef{f:EumeratorTyping}}, this idiom fails.
-
-This idiom leads to another C idiom using an enumeration with matching companion information.
+However, for non-integral typed enumerations, \see{\VRef{f:EumeratorTyping}}, this idiom fails.
+
+This idiom is used in another C idiom for matching companion information.
 For example, an enumeration is linked with a companion array of printable strings.
 \begin{cfa}
@@ -197,3 +220,3 @@
 
 \bigskip
-While C provides a true enumeration, it is restricted, has unsafe semantics, and does provide useful enumeration features in other programming languages.
+While C provides a true enumeration, it is restricted, has unsafe semantics, and does not provide useful enumeration features in other programming languages.
