
Language Features
SC100 C Compiler
3-27
3.4 Language Features
This section describes the different language modes accepted by the SC100 C compiler. It also provides
detailed information about the data types and sizes supported, fractional arithmetic representation, intrinsic
functions, pragmas and predefined macros.
3.4.1 C Language Dialects
The compiler accepts three variations of the C language. The standard C language mode is the normal
ANSI/ISO version with extensions, as described in
Section 3.4.1.1,
“
Standard Extensions.
”
This is the
default mode.
The other two C language modes accepted are:
Source files of different C language types may not be compiled together, but once compiled they can be
linked together into a single application.
3.4.1.1 Standard Extensions
This section lists the extensions which are normally accepted in standard C programs. When compiling in
strict ANSI/ISO mode, the compiler issues warnings when these extensions are used.
3.4.1.1.1 Preprocessor extensions
The following preprocessor extensions are accepted:
Comment text can appear at the end of preprocessing directives.
Numbers are scanned according to the syntax for numbers. Thus,
0x123e+1
is scanned as three
tokens instead of one invalid token.
The
#assert
preprocessing extensions of AT&T System V release 4 are allowed. These enable
the definition and testing of predicate names. Such names are in a name space distinct from all other
names, including macro names. A predicate name can be defined by a preprocessing directive in one
of two forms, as shown in Example 3-9:
Example 3-9. Defining a predicate name
#assert
name
#assert
name(token-sequence)
In the first form, the predicate is not given a value. In the second form, it is given the value
token-sequence
. Such a predicate can be tested in a
#if
expression, as follows:
#name(token-sequence)
. This expression has the value 1 if a
#assert
of that
name
with that
token-sequence
has appeared, otherwise it has the value 0. A predicate may be assigned more than
one value at a given time.
Strict ANSI/ISO mode:
Specified with the shell option
-ansi
. Any ISO C extensions are
flagged with warnings.
K&R/PCC mode:
Specified with the shell option
-kr
. The compiler accepts the older
K&R dialect of C, and provides almost complete compatibility with
the widely used UNIX PCC (
pcc
) dialect. See
Section 3.4.1.2,
“
K&R/PCC mode,
”
for details.