diff --git a/ChangeLog b/ChangeLog index 0ca844b..b400959 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2024-01-30 Richard Stallman + + * c.texi (Lvalues): Dereferencing fn ptr is not an lvalue. + String constant is an lvalue. + Array constructor is an lvalue. + (Write Assignments Separately): Minor cleanup. + (Integer Variations): State minimum sizes of numeric types. + (Unicode Character Codes): Explain invalid universal character names. + (Structures): Define "compound type" and index it. + 2024-01-12 Richard Stallman * c.texi: fix typos. diff --git a/c.texi b/c.texi index 54fa3d4..46de6ed 100644 --- a/c.texi +++ b/c.texi @@ -2646,7 +2646,7 @@ A variable. @item A pointer-dereference expression (@pxref{Pointer Dereference}) using -unary @samp{*}. +unary @samp{*}, if its type is not a non-function type. @item A structure field reference (@pxref{Structures}) using @samp{.}, if @@ -2665,7 +2665,13 @@ An array-element reference using @samp{[@r{@dots{}}]}, if the array is an lvalue. @item -A structure or union constructor. +A string constant (@pxref{String Constants}). + +@item +An array constructor (@pxref{Constructing Array Values}). + +@item +A structure or union constructor (@pxref{Structure Constructors}). @end itemize If an expression's outermost operation is any other operator, that @@ -2989,7 +2995,7 @@ if (x = advance (x), x != 0) @noindent However, putting the assignment in a separate statement is usually clearer -unless the assignment is very short, because it reduces nesting. +(unless the assignment is very short), because it reduces nesting. @node Execution Control Expressions @chapter Execution Control Expressions @@ -3978,10 +3984,10 @@ platform, too. Even for GNU C, there is no general rule. In theory, all of the integer types' sizes can vary. @code{char} is always considered one ``byte'' for C, but it is not necessarily an -8-bit byte; on some platforms it may be more than 8 bits. ISO C -specifies only that none of these types is narrower than the ones -above it in the list in @ref{Basic Integers}, and that @code{short} -has at least 16 bits. +8-bit byte; on some platforms it may be more than 8 bits. @code{short +int} and @code{int} are at least two bytes long (it may be longer). +@code{long int} is at least four bytes long, and @code{long long int} +at least eight bytes long. It is possible that in the future GNU C will support platforms where @code{int} is 64 bits long. In practice, however, on today's real @@ -4793,12 +4799,16 @@ And in an identifier: int foo\u6C34bar = 0; @end example -Codes in the range of @code{D800} through @code{DFFF} are limited to -very specialized uses, too specialized to explain here. Codes less -than @code{00A0} are invalid, except for @code{0024}, @code{0040}, and -@code{0060}; these characters are actually ASCII control characters, -and you can specify them with other escape sequences (@pxref{Character -Constants}). +Codes in the range of D800 through DFFF are invalid in universal +character names. Trying to write them using @samp{\u} causes an +error. Unicode calls them ``surrogate code points'' and uses them in +UTF-16 for purposes too specialized to explain here. + +Codes less than 00A0 are likewise invalid in universal character +names, and likewise cause errors, except for 0024 (@samp{$}), 0040 +(@samp{@@}), and 0060 (@samp{`}). Character codes which can't be +represented with universal character names can be specified with octal +or hexadecimal escape sequences (@pxref{Character Constants}). @node Wide Character Constants @section Wide Character Constants @@ -5850,10 +5860,13 @@ appropriate unsigned integer type. @cindex structures @findex struct @cindex fields in structures +@cindex compound type A @dfn{structure} is a user-defined data type that holds various @dfn{fields} of data. Each field has a name and a data type specified -in the structure's definition. +in the structure's definition. Because a structure combines various +fields, each of its own type, we call a structure type a +@dfn{compound type}. Here we define a structure suitable for storing a linked list of integers. Each list item will hold one integer, plus a pointer