Changeset dcfcf368 for doc/theses/jiada_liang_MMath/background.tex
- Timestamp:
- Sep 14, 2024, 5:07:55 PM (5 weeks ago)
- Branches:
- master
- Children:
- 8c79dc3c
- Parents:
- 3733643
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/jiada_liang_MMath/background.tex
r3733643 rdcfcf368 15 15 \item 16 16 For @#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.17 Furthermore, these C preprocessor macro names are outside the C type system and can unintentionally change program text. 18 18 \item 19 19 The 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{ … … 136 136 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} 137 137 \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. 139 On 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. 140 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. 141 On 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. 140 142 \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. 141 143 Hence, initialization in the range @INT_MIN@..@INT_MAX@ results in a 4-byte enumerator, and outside this range, the enumerator is 8 bytes. 142 144 Note 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@{}} 151 Type & 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 \\ 157 pointer & 8 & 8 158 \end{tabular} 159 \end{table} 143 160 144 161 \begin{figure} … … 483 500 More type assertions mean more constraints on argument types, making the function less generic. 484 501 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@. 503 A 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. 487 504 For example, the conversion cost from @int@ to a @struct S@ is @infinite@. 488 505
Note: See TracChangeset
for help on using the changeset viewer.