Ignore:
Timestamp:
Sep 14, 2024, 5:07:55 PM (5 weeks ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
8c79dc3c
Parents:
3733643
Message:

final proofread of thesis

File:
1 edited

Legend:

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

    r3733643 rdcfcf368  
    1515\item
    1616For @#define@, the programmer must explicitly manage the constant name and value.
    17 Furthermore, these C preprocessor macro names are outside the C type system and can unintentionally change semantics of a program.
     17Furthermore, these C preprocessor macro names are outside the C type system and can unintentionally change program text.
    1818\item
    1919The same explicit management is true for the @const@ declaration, and the @const@ variable cannot appear in constant-expression locations, like @case@ labels, array dimensions,\footnote{
     
    136136A ``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}
    137137\end{quote}
    138 However, @int@ means 4 bytes on both 32/64-bit architectures, which does not seem like the ``natural'' size for a 64-bit architecture.
    139 % 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.
     138\VRef[Table]{t:IntegerStorageSizes} shows integer storage sizes.
     139On UNIX systems (LP64), @int@ means 4 bytes on both 32/64-bit architectures, which does not seem like the ``natural'' size for a 64-bit architecture.
     140Whereas @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.
     141On Windows systems (LLP64), @int@ and @long@ mean 4 bytes on both 32/64-bit architectures, which also does not seem like the ``natural'' size for a 64-bit architecture.
    140142\VRef[Figure]{f:gccEnumerationStorageSize} shows both @gcc@ and @clang@ partially ignore this specification and type the integral size of an enumerator based on its initialization.
    141143Hence, initialization in the range @INT_MIN@..@INT_MAX@ results in a 4-byte enumerator, and outside this range, the enumerator is 8 bytes.
    142144Note that @sizeof( typeof( IMin ) ) != sizeof( E )@, making the size of an enumerator different than its containing enumeration type, which seems inconsistent.
     145
     146\begin{table}
     147\centering
     148\caption{Integer Storage Sizes (bytes)}
     149\label{t:IntegerStorageSizes}
     150\begin{tabular}{@{}rcc@{}}
     151Type                            & LP64  & LLP64 \\
     152@char@                          & 1             & 1             \\
     153@short@ @int@           & 2             & 2             \\
     154@int@                           & 4             & 4             \\
     155@long@ @int@            & 8             & 4             \\
     156@long@ @long@ @int@     & 8             & 8             \\
     157pointer                         & 8             & 8
     158\end{tabular}
     159\end{table}
    143160
    144161\begin{figure}
     
    483500More type assertions mean more constraints on argument types, making the function less generic.
    484501
    485 \CFA defines two special cost values: @zero@ and @infinite@.
    486 A conversion cost is @zero@ when the argument and parameter have an exact match, and a conversion cost is @infinite@ when there is no defined conversion between the two types.
     502\CFA defines two special cost values: 0 and @infinite@.
     503A conversion cost is 0 when the argument and parameter have an exact match, and a conversion cost is @infinite@ when there is no defined conversion between the two types.
    487504For example, the conversion cost from @int@ to a @struct S@ is @infinite@.
    488505
Note: See TracChangeset for help on using the changeset viewer.