
3-34
SC100 C Compiler
Using the SC100 C Compiler
In a declaration of a member of a
struct
or
union
, the declarator list may be omitted entirely, to
specify an unnamed field which requires padding, as shown in Example 3-17. Such a field may not
be a bit-field.
Example 3-17. Omitting the declarator list
struct s {char a; int; char b[2];} v; /* sizeof(v) is 3 */
No warning is generated for a storage specifier appearing in other than the first position in a list of
specifiers (as in
int static
).
The keywords
short
,
long
, and
unsigned
are treated as
“
adjectives
”
in type specifiers, and they
may be used to modify a
typedef
type. For example, the declarations in Example 3-18 result in
s
having type
unsigned long:
Example 3-18. Keywords in type specifiers
typedef long size;
unsigned size s;
Free-standing tag declarations are allowed in the parameter declaration list for a function with
old-style parameters.
Declaration specifiers are allowed to be completely omitted in declarations. (ANSI C allows this
only for function declarations.) Thus
i;
declares
i
as an
int
variable. A warning is issued.
An identifier in a function is allowed to have the same name as a parameter of the function. A
warning is issued.
3.4.1.2.4 K&R/PCC mode type differences
The following are the type differences relative to the default standard mode:
Integral types with the same representation (size, signedness, and alignment) will be considered
identical and may be used interchangeably. For example, this means that
int
and
long
will be
interchangeable if they have the same size.
All enums
are given type
int
. In ANSI mode, smaller integral types will be used if possible.
A
“
plain
”
char
is considered to be the same as either
signed char
or
unsigned char
, depending
on the command-line options. In ANSI C,
“
plain
”
char
is a third type distinct from both
signed
char
and
unsigned char
.
All
float
functions are promoted to
double
functions, and any
float
function parameters are
promoted to
double
function parameters.
All
float
operations are executed as
double
.
The types of large integer constants are determined according to the K&R rules. They will not be
unsigned
in some cases where ANSI C would define them that way.