The
TMS34010
C Language
4.7.2
Type
Specifiers
in
Declarations
K&R
8.2
In addition
to
the type-specifiers listed in K&R, objects may be declared
with
enum-specifiers. Enumerations
are
described in Section 4.7.4, page
4-6.
K&R8.4
K&R 10
More type name combinations
are
allowed in
TMS34010
C than
in
K&R
C.
The adjectives
long
and
short
may be used
with
or
without
the
word
int; the
meaning
is
the same in either
case.
The
word
unsigned
can be used in
con-
junction
with
any integer type or alone;
if
alone,
int
is implied.
Long
float
is
a synonym
for
double. Otherwise,
only
one type specifier
is
allowed in a
declaration.
Contrary
to
K&R,
functions
may return structures or unions
in
TMS34010
C.
In addition, structures and unions may
be
used
as
parameters
to
functions and
may be directly assigned.
Formal parameters
to
a function may
be
declared
as
struct
or enum (in addi-
tion
to
the normal function declarations), since
TMS34010
C allows these
types
of
objects
to
be passed to functions.
4.7.3
Structure
and
Union
Declarations
K&R8.5
K&R
14.1
.
4-6
Since the TMS3401 0
is
bit-addressable, no alignment
of
any kind occurs for
structure members.
Ignore any comment in K&R
about
alignment
or
bounda-
ries for structure members. Note that a field
with
width
zero, normally used
to
force alignment.
is
ignored.
It
is
true, however,
that
bit
fields
are
limited to a
width
of
32
bits (see Object Alignment, page
4-4,
and Structure Packing and
Field Manipulation, page
5-3).
Any
integer type may be declared
asa
field. Fields
are
treated
as
signed unless
declared otherwise. Also, contrary
to
K&R, pointers
to
fields
are
legal in
TMS34010
C.
K&R states
that
structure and union member names must be mutually distinct.
In TMS3401 0
C,
members
of
different structures
or
unions may have the same
name. However, this requires that references
to
the member
be
fully qualified
through
all levels
of
nesting.
Again,
TMS34010
C
allows
assignment to
and
from structures, passing
structures as parameters,
and
returning structures from functions.
There
is
a comment in K&R regarding the compiler determining the type
of
a
structure reference
by
the member name. Since member names
are
not
re-
quired
to
be unique in TMS3401 0
C,
this
is
not
valid. All structure references
must be
fully
qualified
as
members
of
the structure or union
in
which
they
were declared.