A.17. Anachronisms. Microware C Compiler
Reklama
Reklama
Appendix A. C Reference Manual pointer to a char pointer and inspecting the pointed-to storage) but must be accounted for when conforming to externally-imposed storage layouts.
The language accepted by the various compilers differs in minor details. Most notably, the current PDP-11 compiler will not initialize structures containing bitfields, and does not accept a few assignment operators in certain contexts where the value of the assignment is used.
A.17. Anachronisms
Since C is an evolving language, certain obsolete constructions may be found in older programs. Although most versions of the compiler support such anachronisms, ultimately they will disappear, leaving only a portability problem behind.
Earlier versions of C used the form =
op
instead of
op
= for assignment operators.
This leads to ambiguities, typified by: x=-1 which actually decrements x since the = and the - are adjacent, but which might easily be intended to assign -1 to x.
The syntax of initializers has changed: previously, the equals sign that introduces and initializer was not present, so instead of int x = 1; one used int x 1;
The change was made because the initialization int f (1+2) resembles a function declaration closely enough to confuse the compilers.
A.18. Syntax Summary
This summary of C syntax is intended more for aiding comprehension than as an exact statement of the language.
A.18.1. Expressions
The basic expressions are: expression: primary
* expression
&lvalue
- expression
! expression
~ expression
++ lvalue
--lvalue lvalue ++ lvalue -sizeof expression sizeof ( type-name
)
( type-name ) expression expression binop expression expression ? expression : expression lvalue asgnop expression expression , expression
97
Preuzimanje
Reklama