File Types: Specification

Tools Development Guide

Version: 2.1        Date: 2015-04-21 Download Version Released Comments 2.1 2015-04-21 download

XS1 Ports Introduction

Version: 3        Date: 2014-09-16 Download Version Released Comments 3 2014-09-16 Auto check-in from xdoc download 1.0 2013-11-12 download

xCONNECT Architecture

Version: 1.0        Date: 2013-11-14 Download Version Released Comments 1.0 2013-11-14 download

XN Specification

Network Elements

xTIMEcomposer supports a single XN file that contains a single network
definition. The network definition is specified as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://1m2n3b4v.xmos.com"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://1m2n3b4v.xmos.com http://1m2n3b4v.xmos.com">

The XN hierarchy of elements is given in the table below

XN hierarchy of elements
Node Number Description
Network 1 An xCORE network
  Declarations 0+
    Declaration 1+ xCORE Tile declaration
  Packages 1+
    Package 1+ Device package
      Nodes 1
        Node 1+ Node declaration
          Tile 1+ An xCORE Tile
            Port 0+ An xCORE symbolic port name
          Boot 0 or 1 Boot method
            Source 1 Binary location
            Bootee 0+ Nodes booted
          RoutingTable 0 or 1
           Bits 1
            Bit 1+ Direction for bit
           Links 1
            Link 1+ Direction for link
          Service 0+ Service declaration
           Chanend 1+ Chanend parameter
      Links 0 or 1
        Link 1+ xCONNECT Link declaration
          LinkEndpoint 2 xCONNECT Link endpoint
  ExternalDevices 0 or 1
    Device 1+ External device
      Attribute 0+ A device attribute
  JTAGChain 0 or 1
    JTAGDevice 1+ A device in the JTAG chain

Declaration

A Declaration element provides a symbolic name for one or more
xCORE Tiles. A single name or an array of names is supported with the form:

tileref identifier

tileref identifier [ constant-expression ]

An equivalent declaration is exported to the header file <platform.h> for use in
XC programs. A tileref declaration is associated with physical xCORE tiles by the
reference attribute of a Tile element
.

Example

<Declaration>tileref master</Declaration>
<Declaration>tileref tile[8]</Declaration>

Package

A Package element refers to a package file that describes the
mapping from xCORE ports and links to the pins on the package.

XN Package element

Attribute

Required

Type

Description

Id

Yes

String

A name for the package. All package names in the network must be unique.

Type

Yes

String

The name of the XML package. The tools search for the file type.pkg in
the path specified by XCC_DEVICE_PATH.

Example

<Package id="L2" Type="XS1-L2A-QF124">

The package named L2 is described in the file XS1-L2A-QF124.xml.

Node

A Node element defines a set of xCORE Tiles in a network, all of which
are connected to a single switch. XMOS devices such as the G4 or L1 are
both examples of nodes.

XN Node element

Attribute

Required

Type

Description

Id

No

String

A name for the node. All node names in the network must be unique.

Type

Yes

String

If type is periph:XS1-SU the node is a XS1-SU peripheral node.
Otherwise the type specifies the name of an XML file that
describes the node. The tools search for the file
config_type.xml in the path specified by
XCC_DEVICE_PATH.

Reference

Yes

String

Associates the node with a xCORE Tile indentifer specified in a
Declaration. This attribute is only valid on nodes with type
periph:XS1-SU.

RoutingId

No

Integer

The routing identifier on the xCONNECT Link network.

InPackageId

Yes

String

Maps the node to an element in the package file.

Oscillator

No

String

The PLL oscillator input frequency, specified as a number followed by
either MHz, KHz or Hz.

OscillatorSrc

No

String

The name of the node which supplies the PLL oscillator input.

SystemFrequency

No

String

The system frequency, specified as a number followed by either MHz,
KHz or Hz. Defaults to 400MHz if unset.

PllFeedbackDivMin

No

Integer

The minimum allowable PLL feedback divider. Defaults to 1 if unset.

ReferenceFrequency

No

String

A reference clock frequency, specified as a number followed by either
MHz, KHz or Hz. Defaults to 100MHz if unset.

PllDividerStageOneReg

No

Integer

The PLL divider stage 1 register value.

PllMultiplierStageReg

No

Integer

The PLL multiplier stage register value.

PllDividerStageTwoReg

No

Integer

The PLL divider stage 2 register value.

RefDiv

No

Integer

SystemFrequency / RefDiv = ReferenceFrequency

The PLL registers can be configured automatically using the attributes
SystemFrequency, PllFeedbackDivMin and ReferenceFrequency,
or can be configured manually using the attributes
PllDividerStageOneReg, PllMultiplierStageReg,
PllDividerStageTwoReg and RefDiv. If any of the first three
attributes are provided, none of the last four attributes may be
provided, and vice versa.

The PLL oscillator input frequency may be specifed using the Oscillator or
OscillatorSrc attribute. If the Oscillator attribute is provided the
OscillatorSrc attribute must not be provided, and vice versa.

If manual configuration is used, the attributes PllDividerStageOneReg,
PllMultiplierStageReg, PllDividerStageTwoReg and RefDiv must be
provided and the PLL oscillator input frequency must be specifed.
The tools use these values to set the PLL registers and reference clock divider.
Information on the PLL dividers can be found in xCORE frequency control
documents for XS1-G processors
and XS1-L processors
.

If the oscillator frequency is specifed and none of the manual PLL attributes
are provided, automatic configuration is used.
The tools attempt to program the PLL registers such that the target system
frequency is achieved, the PLL feedback divider is greater than or equal
to the minimum value and the target reference clock frequency is
achieved. If any of these constraints cannot be met, the tools issue a
warning and report the actual values used.

If the oscillator frequency is not specified,
the tools do not attempt to configure the PLL. The PLL registers remain at
their initial values as determined by the mode pins.

A network may contain either XS1-L devices or XS1-G devices, but not
both.

Example

<Node Id="MyL1" Type="XS1-L1A" Oscillator="20Mhz"
      SystemFrequency="410MHz" ReferenceFrequency="98.5Mhz">

The node named MyL1 is an L1 device, as described in the file
config_XS1-L1A.xml.

Tile

A Tile element describes the properties of a single xCORE Tile.

XN Tileref element

Attribute

Required

Type

Description

Number

Yes

Integer

A unique number for the tile in the node. Must be a value between 0 and
n-1 where n is the number of tils as defined in the node’s XML
file.

Reference

No

String

Associates the tile with an identifier with the form tile[n] in a
Declaration. A tile may be associated with at most
one identifier.

Example

<Tile Number="0" Reference="tile[0]">

Port

A Port element provides a symbolic name for a port.

XN Port element

Attribute

Required

Type

Description

Location

Yes

String

A port identifier defined in the standard header file <xs1.h>. The ports
are described in the XC manual
.

Name

Yes

String

A valid C preprocessor identifier. All port names declared in the
network must be unique.

Example

<Port Location="XS1_PORT_1I" Name="PORT_UART_TX"/>
<Port Location="XS1_PORT_1J" Name="PORT_UART_RX"/>

Boot

A Boot element defines the how the node is booted. It contains one
Source element
and zero or more
Bootee elements
that are booted over
xCONNECT Links. If the source specifies an xCONNECT Link, no Bootee elements
may be specified. In a line of XS1-L devices, bootees must be contiguous
to the device booting from SPI.

The XMOS tools require a Boot element to be able to
boot programs from flash memory
.

Source

A Source element specifies the location from which the node boots.
It has the following attributes.

XN Source element

Attribute

Required

Type

Description

Location

Yes

String

Has the form SPI: or LINK. The device-name must be
declared in the set of Device elements.

Only XMOS XS1-L devices can be configured to boot over xCONNECT Links.

Example

<Source Location="SPI:bootFlash"/>

Bootee

A Bootee element specifies another node in the system that this node
boots via an xCONNECT Link. If more than one xCONNECT Link is configured between
this node and one of its bootees (see Link
and
LinkEndpoint
), the tools pick one to use for booting.

XN Bootee element

Attribute

Required

Type

Description

NodeId

Yes

String

A valid identifier for another node.

Example

<Bootee NodeId="Slave">

Bit

A Bit element specifies the direction for messages whose first mismatching
bit matches the specified bit number.

XN Bit element

Attribute

Required

Type

Description

number

Yes

Integer

The bit number, numbered from the least significant bit.

direction

Yes

Integer

The direction to route messages.

Example

<Bit number="1" direction="0"/>

When it appears within a RoutingTable element, a Link element specifies
the direction of an xCONNECT Link.

XN Link element

Example

<Link number="XLA" direction="2"/>

Service

A Service element specifies an XC service function provided by a node.

XN Service element

Attribute

Required

Type

Description

Proto

Yes

String

The prototype for the service function, excluding the service keyword.
This prototype is exported to the header file <platform.h> for use in
XC programs.

Example

<Service Proto="service_function(chanend c1, chanend c2)">

Chanend

A Chanend element describes a channel end parameter to an XC service
function.

XN Service element

Attribute

Required

Type

Description

Indentifier

Yes

String

The identifier for the chanend argument in the service function
prototype.

end

Yes

Integer

The number of the channel end on the current node.

remote

Yes

Integer

The number of the remote channel end that is connected to the channel
end on the current node.

Example

<Chanend Identifier="c" end="23" remote="5"/>

xCONNECT Links are described in the system specification documents (XS1-G:
X7507
, XS1-L: X1151
) and link performance documents
(XS1-G: X7561
, XS1-L: X2999
).

A Link element describes the characteristics of an xCONNECT Link. It must
contain exactly two LinkEndpoint children
.

XN Link element

Example

<Link Encoding="2wire" Delays="4,4">

LinkEndpoint

A LinkEndpoint describes one end of an xCONNECT Link, the details of
which can be found in the system specification documents (XS1-G: X7507
,
XS1-L: X1151
). Each endpoint associates a node identifier to a physical
xCONNECT Link.

XN LinkEndpoint element

Attribute

Required

Type

Description

NodeID

No

String

A valid node identifier.

Link

No

String

A link identifier in the form XnLm where n denotes a tile number
and m the link letter. See the corresponding package datasheet for
available link pinouts.

RoutingId

No

Integer

The routing identifier on the xCONNECT Link network.

Chanend

No

Integer

A channel end.

An endpoint is usually described as a combination of a node identifier
and link identifier. For a streaming debug link, one of the endpoints
must be described as a combination of a routing identifier and a channel
end.

Example

<LinkEndpoint NodeId="0" Link="X0LD"/>
<LinkEndpoint RoutingId="0x8000" Chanend="1">

Device

A Device element describes a device attached to an xCORE Tile
that is not connected directly to an xCONNECT Link.

XN Device element

Attribute

Required

Type

Description

Name

Yes

String

An identifier that names the device.

NodeId

Yes

String

The identifier for the node that the device is connected to.

Tile

Yes

Integer

The tile in the node that the device is connected to.

Class

Yes

String

The class of the device.

Type

No

String

The type of the device (class dependent).

xTIMEcomposer recognizes the Class SPIFlash and use the Type
attribute to identify the model of the flash device.

Attribute

An Attribute element describes one aspect of a
Device
.

XN Attribute element

Attribute

Required

Type

Description

Name

Yes

String

Specifies an attribute of the device.

Value

Yes

String

Specifies a value associated with the attribute.

xTIMEcomposer supports the following attribute names for the device
class SPIFlash:

PORT_SPI_MISO

SPI Master In Slave Out signal.

PORT_SPI_SS

SPI Slave Select signal.

PORT_SPI_CLK

SPI Clock signal.

PORT_SPI_MOSI

SPI Master Out Slave In signal.

Example

<Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO"/>

JTAGDevice

xTIMEcomposer loads and debugs programs on target hardware using JTAG.
The JTAGChain element describes a device in the JTAG chain. The order of
these elements defines their order in the JTAG chain.

XN JTAGDevice element

Attribute

Required

Type

Description

NodeID

Yes

String

A valid node identifier.

Example

<!-- N1 comes before N2 in the JTAG chain -->
<JTAGDevice NodeId="N1">
<JTAGDevice NodeId="N2">

XCC Target-Dependent Behavior for XS1 Devices

This section describes behavior of the XMOS compiler collection that is specific
to the XS1 architecture.

Support for Clock Blocks

An XS1 device provides a single reference clock that ticks at a frequency derived from an
external oscillior. XC requires the system designer to ensure that the reference clock ticks at
100MHz for correct operation of timers.

Each xCORE Tile provides a set of programmable clock blocks, which can be used to produce clock
signals for ports. A clock block can use either a 1-bit port or a divided reference clock.

The <xs1.h> header file includes a clock type definition. A variable of
type clock, not declared extern, must be initialized with an
expression representing a clock block, for example:

clock c = XS1_CLKBLK_1;

The number of clock blocks available is given in the device datasheet.
Their names are as the above declaration, numbered sequentially from 1.

In XC, the clock type is a resource type, with the following additional
rules:

  • A structure may declare members of type clock. Variables of a
    structure with type clock may be declared only as external
    declarations.
  • A variable declaration prefixed with on may declare an object of
    type clock.
  • Automatic variables may not be declared with type clock.

Support for Ports

The XC port declaration

port p;

declares a raw port. On XS1 devices, all ports used for inputting and
outputting data are clocked by a 100MHz reference clock (see
Support for Clock Blocks
) and use a single-entry buffer, even if their
declarations are not qualified with the keyword buffered.

The table in I/O operations supported on XS1 ports
can be used
to determine which I/O operations are supported on XS1 ports, depending
on whether or not the corresponding XC declaration is qualified with the
keyword buffered.

I/O operations supported on XS1 ports
Mode Operation
Serialisation Strobing @ when
Unqualified N N N
buffered Y Y Y

The compiler detects and issues errors in the following cases:

  • Serialization: A port not qualified with buffered is declared
    with a transfer width different from the port width.
  • Strobing: A port not qualified with buffered is configured to use
    a ready-in or ready-out signal.
  • An input uses both @ and when: Both of these operators are
    used in an input statement with a port whose declaration is not
    qualified with buffered.

Serialization

Note that if serialization is used, the time
specified by a timed input statement records the time at which the
last bits of data are sampled. This can result in unexpected behaviour
when serialization is used, since the construction

par {
  p @ t <: x;
  q @ t :> y;
}

causes the output on p to start at the same time as the input on
q completes. To input and output this data in parallel, the input
time should be offset in the software by an amount equal to the the
transfer width divided by the port width.

Timestamping

The timestamp recorded by an input statement may come after the time
when the data was sampled. This is because the XS1 provides separate
instructions for inputting data and inputting the timestamp, so the
timestamp can be input after the next data is sampled. This issue also
affects output statements, but does not affect inputs performed in the
guards of a select statement. The compiler inputs the timestamp
immediately after executing an input or output instruction, so in
practice this behaviour is rarely seen.

Changing Direction of Buffered Ports

An attempt to change the direction of a port qualified with buffered
results in undefined behaviour.

Channel Communication

On some revisions of the XS1 architecture, it is not possible to input data
of size less than 32 bits from a streaming channel in the guard of a select
statement.

  • When compiling for the XS1-G architecture, the compiler disallows
    selecting on a channel input of less than a word-length in an XC
    streaming channel. The command line option -fsubword-select
    relaxes this restriction, but this can lead to cases with these
    functions not being taken even if data is available on the channel.
  • When compiling for the XS1-G architecture, the inuchar_byref,
    inct_byref and testct functions may not be used in an XC
    select statement. The command line option -fsubword-select
    relaxes this restriction, but this can lead to cases with these
    functions not being taken even if data is available on the channel.

Documentation

XC Specification

The specification given in this document describes version 1.0 of
XC.

The layout of this manual and portions of its text are based upon
the K&R definition of C
. Commentary material
highlighting differences between XC and C is indented and written
in smaller type.

Lexical Conventions

A program consists of one or more translation units stored in
files. It is translated in several phases, which are described in
Preprocessing
. The first phases perform low-level lexical
transformations, carry out directives introduced by lines beginning
with the # character, and perform macro definition and
expansion. When the preprocessing of Preprocessing
is complete,
the program has been reduced to a sequence of tokens.

Tokens

There are six classes of tokens: identifiers, keywords, constants,
string literals, operators, and other separators. Blank spaces,
horizontal tabs, newlines, formfeeds, and comments as described
below, collectively referred to as white space, are ignored
except as they separate tokens. Some white space is required to
separate otherwise adjacent identifiers, keywords and constants.

Comments

Two styles of commenting are supported: the characters /*
introduce a comment, which terminates with the characters */,
and the characters // introduce a comment, which terminates
with a newline. Comments may not be nested, and they may not occur
within string or character literals.

Identifiers

An identifier is a sequence of letters, digits and underscore
(_) characters of any length; the first character must not be a
digit. Upper and lower case letters are different.

Keywords

The following identifiers are reserved for use as keywords and may
not be used otherwise:

auto

else

return

union

break

enum

short

unsigned

case

extern

signed

void

char

for

sizeof

volatile

const

if

static

while

continue

int

struct

 

default

long

switch

 

do

register

typedef

 

The following identifiers are also reserved for use as keywords and
may not be used otherwise:

buffered

inline

out

slave

chan

isnull

par

streaming

chanend

master

port

timer

core

null

select

transaction

in

on

service

when

The construction port:n where n is a
sequence of digits is also a valid identifier. The sequence of
digits is taken to be decimal and is interpreted as an integer
constant. The following identifiers are reserved for compatibility
issues and for future use:

accept

claim

float

restrict

asm

double

module

 

Constants

There are several kinds of constants. Each has a data type;
Basic Types
discusses the basic types.

constant ::= integer-constant
| character-constant
| enumeration-constant
| null

Floating-point constants are unsupported.

Integer Constants

A sequence of digits is taken to be binary if preceded by 0b or
0B, octal if preceded by 0, hexadecimal if preceded by
0x or 0X, and decimal otherwise. integer constant may be
suffixed by the letter u or U (unsigned), the letter l
or L (long), or both (unsigned long).

The type of an integer constant depends on its form, value and
suffix. (See Meaning of Identifiers
for a discussion of types.) An
unsuffixed decimal constant has the first of the following types in
which its value can be represented: int, long int,
unsigned long int; an unsuffixed octal or hexadecimal constant
has the first possible of types: int, unsigned int,
long int, unsigned long int. An unsigned constant has
the first possible of types: unsigned int,
unsigned long int; a long constant has the first possible
of types: long int, unsigned long int.

Character Constants

A character constant is a sequence of one or more characters
(excluding the single-quote and newline characters) enclosed in
single quotes. The value of a character constant with a single
character is the numeric value of the character in the machine’s
character set at execution time. The value of a multi-character
constant is implementation-defined.

Wide character constants are unsupported.

The following escape sequences are supported.

newline

NL

\n

backslash

\

\\

horizontal tab

HT

\t

question mark

?

\?

vertical tab

VT

\v

single quote

\'

backspace

BS

\b

double quote

\"

carriage return

CR

\r

octal number

ooo

\ooo

formfeed

FF

\f

hex number

hh

\xhh

audible alert

BEL

\a

     

The escape sequence \ooo requires one, two or three
octal digits. The sequence \xhh requires one or more
hexadecimal digits; its behaviour is undefined if the resulting
character value exceeds that of the largest character. For either
octal or hexadecimal escape characters, if the implementation
treats the char type as signed, the value is sign-extended as if
cast to char type. If any other character follows the \ then
the behaviour is undefined.

Enumeration Constants

Identifiers declared as enumerators (see Enumerations
) are
constants of type int.

Null Constants

The null constant has type null.

String Literals

A string literal is a sequence of zero or more characters
(excluding the double-quote and newline characters) enclosed in
double quotes. It has type “array of characters” and storage class
static (see Storage Class
) initialised with the given
characters. Whether identical string literals are distinct is
implementation-defined, and the behaviour of a program that
attempts to alter a string literal is undefined.

Adjacent string literals are concatenated into a single string.
After any concatenation, a null byte \0 is appended to the
string. All of the character escape sequences are supported.

Syntax Notation

In the syntax notation used in this manual, syntactic categories
are indicated by sans serif type, and literal words and characters by
typewriter style. An optional terminal or nonterminal symbol
carries the subscripted suffix “opt,” so that, for example,

{ expressionopt }

means an optional expression, enclosed
in braces. The terms “zero or more” and “one or more” are
represented using angled brackets along with the star (*) and plus
(+) symbols respectively, so that, for example,

⟨declaration⟩*

means a sequence of zero or more declarations, and

⟨declaration⟩+

means a sequence of one or more declarations.

Meaning of Identifiers

Identifiers (or names) refer collectively to functions, tags of
structures and unions, members of structures or unions, and
objects. An object (or variable) is a location in storage, and its
interpretation depends on its storage class and its type. The
storage class determines the lifetime of the storage associated
with the identifier; the type determines the meaning of the values
found in the identified object. A name also has scope, which is the
region of the program in which it is known, and a linkage, which
determines whether the same name in another scope refers to the
same object or function. Scope and linkage are discussed in
Scope and Linkage
.

Storage Class

An object has either automatic or static storage. Automatic
objects are local to a block (Compound Statement
) and are discarded
on exit from the block. Declarations within a block create
automatic objects if no storage class is mentioned, or if the
auto or register specifier is used.

Static objects may be local to a block or external to all blocks,
but in either case retain their values across exit from and reentry
to functions and blocks. Within a block, static objects are
declared with the keyword static. The objects declared outside
all blocks, at the same level as function definitions, are always
static. They may be made local to a particular translation unit by
use of the static keyword; this gives them file-scope (or
internal linkage). They become global to an entire program by
omitting an explicit storage class, or by using the keyword
extern; this gives them program-scope (or
external linkage).

A function may be declared with the keyword service. This
specifier has no effect on the behaviour of the function; the
extent to which suggestions made by using this specifier are
effective is implementation-defined.

Basic Types

Objects declared as char are large enough to store any member of
the execution character set. If a genuine character from that set
is stored in a char object, its value is equivalent to the
integer code for the character, and is non-negative. Other
quantities may be stored into char variables, but the available
range of values, and especially whether the value is signed, is
implementation-defined.

Objects declared unsigned char consume the same amount of space
as plain characters, but always appear non-negative; explicitly
signed characters declared signed char likewise take the same
space as plain characters.

In addition to the char type, up to three sizes of integer are
available, declared short int, int and long int. Plain
int objects have the natural size suggested by the host machine
architecture. Longer integers provide at least as much storage as
shorter ones, but the implementation may make plain integers
equivalent to either short or long integers. The int types all
represent signed values unless specified otherwise.

Unsigned integers obey the laws of arithmetic modulo
2n where n is the number of bits in the
representation. The set of non-negative values that can be stored
in a signed object is a subset of the values that can be stored in
the corresponding unsigned object, and the representation for the
overlapping values is the same.

All of the above types are collectively referred to as arithmetic
types, because they can be interpreted as numbers, and as
integral types, because they represent integer values.

The void type specifies an empty set of values; it is used as
the type returned by functions that generate no value.

The C types long long int, float and double are
unsupported.

The chan type specifies a logical communication channel over
which values can be communicated between parallel statements
(Concurrency Statement
). The chanend type specifies one end of a
communication channel.

The locations of at most two implied ends of chan (themselves
chanends) are defined through the use of the channel in at most
two parallel statements (Concurrency Statement
).

Channel ends are used as operands of input and output statements
(Input and Output Statements
). Channels are bidirectional and synchronised:
an outputter waits for a matching inputter to become ready before
data is communicated. Whether a streaming channel is synchronised
or unsynchronised is implementation-defined.

The port type specifies a p-bit register, which interfaces to
a collection of p pins used for communicating with the
environment where p is implementation-defined. The
port:n type specifies an n-bit register, which
interfaces to a collection of p pins used for communicating with
the environment (where p need not equal n). A void port is
a special type of port that may not be used for input or output. A
port also has a notional transfer type and counter type (see
Input and Output Statements
); these types are implementation-defined.

Ports are used as operands of input and output statements
(Input and Output Statements
).

The timer type is a special type of input port that returns the
current time when input from. A void timer is a timer that may
not be used for input. A timer also has a notional counter type (see
Input and Output Statements
); this type is implementation-defined.

The core type specifies a processor core on which ports and
parallel statements may be placed. Objects of core type do not
reserve storage.

Channel ends, ports, timers and cores are collectively referred to
as having resource types. Except for cores, which do not reserve
storage, an object of resource type refers to a location in storage
in which an identifier for the resource is recorded.

chan, chanend, port, timer, core,
buffered and streaming are new.

Derived Types

In addition to the basic types, the following derived types may be
constructed in the following ways:

  • Arrays of objects of a given type.
  • Functions returning objects of a given type.
  • References to objects of a given type.
  • Structures containing a sequence of objects of various types.
  • Unions capable of containing any one of several objects of
    various types.
  • Lists of objects containing a sequence of objects of various
    types.

In general these methods of constructing objects can be applied
recursively.

Lists of types are used in multiple assignment statements
(Multiple Assignment Statement
); pointers are replaced by references (see
Reference Generation
; Function Calls
;
Reference Declarators
).

Type Qualifiers

An object’s type may be qualified const, which announces that
its value will not be changed; its range of values and arithmetic
properties is unaffected.

A port may be qualified in or out, which announces that it
will only be used for input or output operators
(Input and Output Statements
).

Qualifiers are discussed in Function Calls
and
Type Specifiers
.

in and out are new.

Objects and Lvalues

An object is a named region of storage; an lvalue is a
reference to an object. For example, if str is an identifier of
type “1-dimensional array of char” then str[0] is an lvalue
referring to the character object indexed by the first element of
the array str.

A modifiable lvalue is an lvalue which is modifiable: it must not
be an array, and must not have a resource or incomplete type, or be
a function. Also, its type must not be qualified with const; if
it is a structure or union, it must not have any member or,
recursively, submember qualified with const.

Conversions

Some operators, depending on their operands, cause conversion of
the value of an operand from one type to another. This section
explains the results to be expected from such conversions.
It details the conversions demanded by most operators.

Integral Promotion

A character or a short integer, both either signed or not, may be
used in an expression wherever an integer may be used. If an
int can represent all the values of the original type then the
value is converted to int, otherwise the value is converted to
unsigned int.

Integral Conversions

Any integer is converted to a given unsigned type by finding the
smallest non-negative value that is congruent to that integer,
modulo one more than the largest value that can be represented in
the unsigned type.

When any integer is converted to a signed type, its value is
unchanged if it can be represented in the new type, and
implementation-defined otherwise.

Arithmetic Conversions

Many operators cause conversions which bring their operands into a
common type, which is also the type of the result. The rules for
performing these usual arithmetic conversions are as follows:

  • First, integral promotions are performed on both operands.
  • If either operand is unsigned long int then the other is
    converted to unsigned long int.
  • Otherwise, if one operand is long int and the other is
    unsigned int then: if a long int can represent all
    values of an unsigned int then the unsigned int operand is
    converted to long int, otherwise both operands are converted to
    unsigned long int.
  • Otherwise, if one operand is long int then the other is
    converted to long int.
  • Otherwise, if either operand is unsigned int then the other
    is converted to unsigned int.
  • Otherwise both operands have type int.

Void

The (nonexistent) value of a void object may not be used in any
way, and neither explicit nor implicit conversion to any non-void
type may be applied. An object of type void port or
void timer may not be used for input or output.

Expressions

The precedence of expression operators is the same as the order of
the major subsections of this section, highest precedence first.
Within each section, the operators have the same precedence. Left-
or right-associativity is specified in each subsection for the
operators discussed therein.

The precedence and associativity of operators is fully specified.
The order of evaluation of expressions does not, with certain
exceptions, affect the behaviour of the program, even if the
subexpressions involve side effects. In particular, a variable
which is changed in one part of an expression may not unless
otherwise stated appear in any other part of the expression. This
rule applies recursively to all variables which are changed in
functions called in the expression.

The handling of overflow, divide check, and other exceptions in
expression evaluation is implementation-defined.

Reference Generation

If the type of an expression is “array of T,” for some type T,
then the value of the expression is a reference to the array, and
the type of the expression is altered to “reference to array of T.”

Primary Expressions

Primary expressions are variable references, function calls,
constants, strings, or expressions in parentheses:

primary-expression ::= variable-reference
| function-call
| constant
| string
| ( expression )

A variable reference is a primary expression, providing the
identifier named (Postfix Expressions
) has been suitably declared as
discussed below; the type of the identifier is specified by its
declaration; the type of the expression is that of the identifier.

A function call is a primary expression; the type of the expression
depends on the return type of the function
(Function Calls
).

A constant is a primary expression; the type of the expression is
that of the constant (which depends on its form discussed in
Constants
).

A string literal is a primary expression; the type of the
expression is “array of char.”

A parenthesised expression is a primary expression whose type and
value are identical to those of the unadorned expression.

Postfix Expressions

The operators in postfix expressions group left to right.

postfix-expression ::= primary-expression
| variable-reference ++
| variable-reference --
variable-reference ::= identifier
| variable-reference [ expression ]
| variable-reference . identifier
| ( variable-reference , type-name )
function-call ::= identifier ( expression-listopt )
expression-list ::= expression
| expression , expression-list

Array References

A variable reference followed by an expression in square brackets
is a subscripted array reference. The variable reference must
either have type “n-array of T” or “reference to an n-array of
T,” where n is the number of dimensions and T is some type,
and the expression must have integral type; the type of the
subscripted variable reference is T. If the value of the
expression is less than zero or greater than or equal to n then
the expression is invalid. See Array Declarators
for further
discussion.

Function Calls

A function call is an identifier followed by parentheses containing
an optional list of comma-separated expressions, which constitute
the arguments to the function. If the identifier has type
“transaction function returning void” then the call must be within
the scope of a transaction statement (Transaction Statement
).
Otherwise, the identifier must have type “function returning T,”
or “select function returning T,” for some type T, in which
case the value of the function call has type T.

Function declarations are limited to file-scope only
(External Declarations
). Implicit function declarations (see K&R §A7.3.2)
are unsupported.

The term argument refers to an expression passed by a function
call, and the term parameter refers to an input object (or its
identifier) received by a function definition, or described in a
function declaration.

If the type of a parameter is “reference to T,” for some T,
then its argument is passed by reference, otherwise the argument is
passed by value. In preparing for the call to a function, a copy is
made of each argument that is passed by value. A function may
change the values of these parameter objects, which are copies of
the argument expressions, but these changes cannot affect the
values of the arguments. For objects that are passed by reference,
a function may change the values that these objects dereference,
thereby affecting the values of the arguments. For the purpose of
disjointness checking, passing an object by reference counts as a
write to that object unless the type of the parameter is qualified
as const or an array of objects qualified as const.

For arguments passed by value, the argument and parameter are
deemed to agree in type if the promoted type of the argument is
that of the parameter itself, without promotion. For arguments
passed by reference, the argument and parameter agree in type only
if the types are equivalent (see Type Equivalence
) ignoring all
qualifiers and array sizes, and obey the following rules:

  • An object or an array of objects declared with the qualifier
    const may only be used as an argument to a function with
    parameter qualified const.
  • An object declared with the qualifier in may only be used as
    an argument to a function with parameter qualified in or
    void.
  • An object declared with the qualifier out may only be used
    as an argument to a function with parameter qualified out or
    void.
  • An object declared with the specifier void may only be used
    as an argument to a function with parameter specified void. An
    object not qualified in, out or void may be used as an
    argument to a function with parameter qualified either in,
    out or void.
  • An object declared with the qualifier buffered may only be
    used as an argument to a function parameter qualified buffered.
    An object not declared with the qualifier buffered may only be
    used as an argument to a function parameter not qualified
    buffered.
  • An object declared with the qualifier streaming may only be
    used as an argument to a function parameter qualified
    streaming. An object not declared with the qualifier
    streaming may only be used as an argument to a function
    parameter not qualified streaming.
  • An object declared with an array size of n may only be used as
    an argument to a function parameter that is an array of unknown
    size or of size m where m <= n.
  • An object passed to a parameter declared without the qualifier
    const must be an lvalue.

A variable which is changed in one argument may not appear in any
other argument. This rule applies recursively to all variables
appearing in functions called by the arguments.

The arguments passed by value are converted, as if by assignment,
to the types of the corresponding parameters of the function’s
declaration (or prototype). The number of arguments must be the
same as the number of parameters, unless the declaration’s
parameter list ends with the ellipsis notation (, ...). In that
case, the number of arguments must equal or exceed the number of
parameters; trailing integral arguments beyond the explicitly typed
parameters undergo integral promotion (Integral Promotion
).

The order of evaluation of arguments is unspecified, but the arguments
are completely evaluated, including all side effects, before the
function is entered. Recursive calls to any function are
permitted.

The creation of more than one reference to the same object of basic
type, a structure, a union or an array is invalid. The creation of
a reference to a structure, union or array, and to a member or
element recursively contained within is invalid. The creation of
more than one reference to objects contained within distinct
members of a union is invalid.

Structure References

A variable reference followed by a dot followed by an identifier is
a member reference. The variable reference must be a structure or
union, and the identifier must name a member of the structure or
union. The value is the named member of the structure or union, and
its type is the type of the member.

Structures and unions are discussed in Structure and Union Declarations
.

Reinterpretation

A left parenthesis followed by a variable reference followed by a
comma followed by a type name (Type Names
) followed by a
right parenthesis is a reinterpretation cast.

The variable reference must not specify a resource type; its type
must be complete or it must be an incomplete array with the first
dimension missing which, if provided, completes the type. The
variable type name must not be a resource type; it must be
complete.

If the size of the type of the variable reference is unknown
because it references an array parameter with unknown size then the
following two rules apply. First, if the size of the type name is a
compile-time constant T then at run-time if the size of the
variable reference is less than T then the reinterpret operation
is invalid. Second, if the size of the type name is not known at
compile-time because it is an array in which the largest dimension
is unspecified then at run-time the reinterpret operation provides
a value for the dimension d such that the size of the resulting
type is not larger than the size of the type of the variable
reference, but with a value of d + 1 it would be.

If the size of the type of the variable reference is a compile-time
constant V then the following two rules apply. First, if the size
of the type name is a compile-time constant T then T must not
be greater than V. Second, if the size of the type name is
unknown because it references an array in which the largest
dimension is unspecified then a value for this dimension d is
completed at compile-time such that the size of the resulting type
is not larger than V, but with a value of d + 1 it would be.

No arithmetic conversions are performed: the effect of the
reinterpretation is to treat the variable as if it had the
specified type. An array of size zero is a valid reinterpretation;
any attempted index into the array is invalid.

The use of a reinterpreted object may be invalid if it is not
suitably aligned in storage. It is guaranteed only that an object
may be reinterpreted to an object whose type requires less or
equally strict storage alignment; the notion of “alignment” is
implementation-defined, but objects of the char types have the
least strict alignment requirements.

Unary Operators

Expressions with unary operators group right-to-left.

unary-expression ::= postfix-expression
| ++ variable-reference
| -- variable-reference
| unary-operator cast-expression
| sizeof unary-expression
| sizeof ( type-name )
| isnull ( unary-expression )
unary-operator ::= one of
+ - ~ !

Prefix Incrementation Operators

A unary expression preceded by a ++ or -- operator is a
unary expression. The operand is incremented (++) or
decremented (--) by 1. The value of the expression is the value
after the incrementation (decrementation). The operand must be a
modifiable lvalue; see the discussion of additive operators
(Additive Operators
) and assignment (Assignment Expressions
) for
details of the operation. The result is not an lvalue.

Unary Plus Operator

The operand of the unary + operator must have arithmetic type,
and the result is the value of its operand. An integral operand
undergoes integral promotion; the type of the result is the type of
the promoted operand.

Unary Minus Operator

The operand of the unary - operator must have arithmetic type,
and the result is the negative of its operand. An integral operand
undergoes integral promotion. The negative of an unsigned quantity
is computed by subtracting the promoted value from the largest
value of the promoted type and adding one; but negative zero is
zero. The type of the result is the type of the promoted operand.

One’s (Bitwise) Complement Operator

The operand of the unary ~ operator must have integral type,
and the result is the one’s complement of its operand. The integral
promotions are performed. If the operand is unsigned, the result is
computed by subtracting the value from the largest value of the
promoted type. If the operand is signed, the result is computed by
converting the promoted operand to the corresponding unsigned type,
applying ~, and converting back to the signed type. The type of
the result is the type of the promoted operand.

Logical Negation Operator

The operand of the ! operator must have arithmetic type, and
the result is 1 if the value of its operand compares equal to 0,
and 0 otherwise. The type of the result is int.

Sizeof Operator

The sizeof operator yields the number of bytes required to
store an object of the type of its operand. The operand is either
an expression, which is not evaluated, or a parenthesised type
name. When sizeof is applied to a char, the result is 1;
when applied to an array, the result is the total number of bytes
in the array. When applied to a structure or union, the result is
the number of bytes in the object, including any padding required
to make the object tile an array: the size of an array of n
elements is n times the size of one element. When applied to a
reference, the result is the number of bytes in the object referred
to. The operator may not be applied to an operand of function type,
of resource type or of an incomplete type. The operator may not be
applied to an operand of reference type where the reference is to
an array of unknown size. The value of the result is
implementation-defined. The result is an unsigned integral
constant; the particular type is implementation-defined.

Isnull Operator

The operand of the isnull operator must be an lvalue. The
result is 1 if its operand has value null, and 0 otherwise. The
type of the result is int.

Casts

A unary expression preceded by the parenthesised name of a type
causes conversion of the value of the expression to the named
type.

cast-expression ::= unary-expression
| ( type-name ) cast-expression

This construction is called a cast. The cast must not specify a
structure, a union, an array, or a resource type; neither must the
expression. Type names are described in Type Names
. The
effects of arithmetic conversions are described in
Arithmetic Conversions
. An expression with a cast is not an lvalue.

Multiplicative Operators

C Implementation-Defined Behavior

A conforming C99 implementation is required to document its choice of
behavior for all parts of the language specification that are designated
implementation-defined. xTIMEcomposer implementation-defined
behavior matches that of GCC
4.2.1

except for the choices listed below.

The following section headings refer to sections in the
C99 specification
and all choices that depend on an
externally determined application binary interface are listed as
“determined by ABI,” and are documented in the Application
Binary Interface Specification

.

Only the supported C99 features are documented.

Environment

  • The name and type of the function called at program startup in a
    freestanding environment (5.1.2.1).

    A hosted environment is provided.

  • An alternative manner in which the main function may be defined
    (5.1.2.2.1).

    There is no alternative manner in which main may be defined.

  • The values given to the strings pointed to by argv argument to
    main (5.1.2.2.1).

    The value of argc is equal to zero. argv[0] is a null
    pointer. There are no other array members.

  • What constitutes an interactive device (5.1.2.3).

    All streams are refer to interactive devices.

  • Signal values other than SIGFPE, SIGILL, and SIGSEGV that
    correspond to a computational exception (7.14.1.1).

    No other signal values correspond to a computational exception.

  • Signal values for which is equivalent of signal(sig, SIG_IGN); is
    executed at program startup (7.14.1.1).

    At program startup the equivalent of signal(sig, SIG_DFL); is
    executed for all signals.

  • The set of environment names and the method for altering the
    environment list used by the getenv function (7.20.4.5).

    The set of environment names is empty. There is no method for
    altering the environment list used by the getenv function.

  • The manner of execution of the string by the system function used
    by the getenv function (7.20.4.6).

    This is determined by the execution environment.

Identifiers

  • The number of significant initial characters in an identifier
    (5.2.4.1, 6.4.1).

    All characters in identifiers (with or without external linkage) are
    significant.

Characters

  • The value of the members of the execution character set (5.2.1).

    This is determined by the ASCII character set.

  • The unique value of the member of the execution character set
    produced for each of the standard alphabetic escape sequences
    (5.2.2).

    This is determined by the ASCII character set.

  • The value of a char object into which has been stored any
    character other than a member of the basic execution set (6.2.5).

    The value of any character other than a member of the basic execution
    set is determined by the ASCII character set.

  • The mapping of members of the source character set (in character
    constants and string literals) to members of the execution character
    set (6.4.4.4, 5.1.1.2).

    The source character set is required to be the ASCII character set.
    Each character in the source character set is mapped to the same
    character in the execution character set.

  • The value of an integer character constant containing more than one
    character or containing a character or escape sequence that does not
    map to a single-byte execution character (6.4.4.4).

    The value of an integer character constant containing more than one
    character is equal to the value of the last character in the
    character constant. The value of an integer character constant
    containing a character or escape sequence that does not map to a
    single-byte execution character is equal to the value reduced modulo
    2n to be within range of the char type, where n is
    the number of bits in a char.

  • The value of a wide character constant containing more than one
    multibyte character, or containing a multibyte character or escape
    multibyte character, or containing a multibyte character or escape
    sequence not represented in the extended execution character set
    (6.4.4.4).

    Wide character constants must not contain multibyte characters.

  • The current locale used to convert a wide character constant
    consisting of a single multibyte character that maps to a member of
    the extended execution character set into a corresponding wide
    character code (6.4.4.4).

    Wide character constants must not contain multibyte characters.

  • The value of a string literal containing a multibyte character or
    escape sequence not represented in the execution character set
    (6.4.5).

    String literals must not contain multibyte characters. If an escape
    sequence not represented in the execution character set is used in a
    string literal, the value of the corresponding character in the
    string is the same as the value that would be given to an integer
    character constant consisting of that escape sequence.

Floating point

  • The accuracy of the floating-point operations and of the library
    functions in <math.h> and <complex.h> that return floating-point results
    (5.2.4.2.2).

    This is intentionally left undocumented.

  • Additional floating-point exceptions, rounding modes, environments,
    and classifications, and their macros names (7.6, 7.12).

    No additional floating-point exceptions, rounding modes, environments
    or classifications are defined.

Hints

  • The extent to which suggestions made by using the register
    storage-class specifier are effective (6.7.1).

    The register specifier is ignored except when used as part of the
    register variable extension.

Preprocessing directives

  • The behavior on each recognized non-STDC #pragma directive
    (6.10.6).

    This is documented in XCC Pragma Directives
    .

Library functions

  • Any library facilities available to a freestanding program, other
    than the minimal set required by clause 4 (5.1.2.1).

    A hosted environment is provided.

  • The format of the diagnostic printed by the assert macro
    (7.2.1.1).

    The assert macro uses the format “Assertion failed: expression,
    file filename, line line number, function: function.” where
    expression is the text of the argument, filename is the value of
    __FILE__, line number is the value of __LINE__ and
    function is the name of the current function. If the name of the
    current function cannot be determined, this part of the message is
    omitted.

  • The representation of the floating-point status flags stored by the
    fegetexceptflag function (7.6.2.2).

    The function fegetexceptflag is not supported.

  • Whether the feraiseexcept function raises the “inexact”
    floating-point exception in addition to the “overflow” and
    “underflow” floating-point exception (7.6.2.3).

    The function feraiseexcept is not supported.

  • Strings other than "C" and "" that may be passed as the
    second argument to the setlocale function (7.11.1.1).

    No other strings may be passed as the second argument to the
    setlocale function.

  • The types defined for float_t and double_t when the value of
    the FLT_EVAL_METHOD macro is less than 0 or greater than 2
    (7.12).

    No other values of the FLT_EVAL_METHOD macro are supported.

  • Domain errors for the mathematics functions, other than those
    required by this International Standard (7.12.1).

    This is intentionally left undocumented.

  • The values returned by the mathematics functions on domain errors
    (7.12.1).

    This is intentionally left undocumented.

  • The values returned by the mathematics functions on underflow range
    errors, whether errno is set to the value of the macro ERANGE
    when the integer expression math_errhandling         & MATH_ERRNO
    is nonzero, and whether the “underflow” floating-point exception is
    raised when the integer expression
    math_errhandling & MATH_ERREXCEPT is nonzero (7.12.1).

    This is intentionally left undocumented.

  • Whether a domain error occurs or zero is returned when an fmod
    function has a second argument of zero (7.12.10.1).

    A domain error occurs when an fmod function has a second argument
    of zero.

  • The base-2 logarithm of the modulus used by the remquo functions
    in reducing the quotient (7.12.10.3).

    The quotient is reduced modulo 27.

  • Whether the equivalent of signal(sig, SIG_DFL); is executed prior
    to the call of a signal handler, and, if not, the blocking of signals
    that is performed (7.14.1.1).

    The equivalent of signal(sig, SIG_DFL); is executed prior to the
    call of a signal handler.

  • The null pointer constant to which the macro NULL expands (7.17).

    NULL is defined as ((void *)0).

  • Whether the last line of a text stream requires a terminating
    new-line character (7.19.2).

    This is determined by the execution environment.

  • Whether space characters that are written out to a text stream
    immediately before a newline character appear when read in (7.19.2).

    This is determined by the execution environment.

  • The number of null characters that may be appended to data written to
    a binary stream (7.19.2).

    This is determined by the execution environment.

  • Whether the file position indicator of an append-mode stream is
    initially positioned at the beginning or end of a file (7.19.3).

    This is determined by the execution environment.

  • Whether a write on a text stream causes the associated file to be
    truncated beyond that point (7.19.3).

    This is determined by the execution environment.

  • The characteristics of file buffering (7.19.3).

    A buffered output stream saves characters until the buffer is full
    and then writes the characters as a block. A line buffered output
    stream saves characters until the line is complete or the buffer is
    full and then writes the characters as a block. An unbuffered output
    stream writes characters to the destination file immediately.

  • Whether a zero-length file actually exists (7.19.3).

    This is determined by the execution environment.

  • The rules for composing valid file names (7.19.3).

    This is determined by the execution environment.

  • Whether the same file can be simultaneously opened multiple times
    (7.19.3).

    This is determined by the execution environment.

  • The nature and choice of encodings used for multibyte characters in
    files (7.19.3).

    The execution character set must not contain multibyte characters.

  • The effect of the remove function on an open file (7.19.4.1).

    This is determined by the execution environment.

  • The effect if a file with the new name exists prior to a call to the
    rename function (7.19.4.1).

    This is determined by the execution environment.

  • Whether an open temporary file is removed upon abnormal program
    termination (7.19.4.3).

    Temporary files are not removed on abnormal program termination.

  • Which changes of mode are permitted (if any), and under what
    circumstances (7.19.5.4).

    The file cannot be given a more permissive access mode (for example,
    a mode of “w” will fail on a read-only file descriptor), but can
    change status such as append or binary mode. If modification is not
    possible, failure occurs.

  • The style used to print an infinity or NaN, and the meaning of any
    n-char or n-wchar sequence printed for a NaN (7.19.6.1, 7.24.2.1).

    A double argument representing infinity is converted in the style
    [-]inf. A double argument representing a NaN is converted
    in the style as nan.

  • The output for %p conversion in the fprintf or fwprintf
    function (7.19.6.1, 7.24.2.1).

    The value of the pointer is converted to unsigned hexadecimal
    notation in the style dddd; the letters abcdef are used for the
    conversion. The precision specifies the minimum number of digits to
    appear; if the value being converted can be represented in fewer
    digits, it is expanded with leading zeros. The default precision is
    1. The characters 0x are prepended to the output.

    The fwprintf function is unsupported.

  • The interpretation of a - character that is neither the first nor
    the last character, nor the second where a ^ character is the
    first, in the scanlist for %[ conversion in the fscanf or
    fwscanf function (7.19.6.2, 7.24.2.1).

    The - character is considered to define a range if the character
    following it is numerically greater than the character before it.
    Otherwise the - character itself is added to the scanset.

    The fwscanf function is unsupported.

  • The set of sequences matched by a %p conversion and the
    interpretation of the corresponding input item in the fscanf or
    fwscanf function (7.19.6.2, 7.24.2.2).

    %p matches the same format as %x. The corresponding input
    item is converted to a pointer.

    The fwscanf function is unsupported.

  • The meaning of any n-char or n-wchar sequence in a string
    representing NaN that is converted by the strtod, strtof,
    strtold, wcstod, wcstof or wcstold function
    (7.20.1.3, 7.24.4.1.1).

    The functions wcstod, wcstof and wcstold are not
    supported. A n-char sequence in a string representing NaN is
    scanned in hexadecimal form. Any characters which are not hexadecimal
    digits are ignored.

  • Whether or not the strtod, strtof, strtold, wcstod,
    wcstof or wcstold function sets errno to ERANGE when
    underflow occurs (7.20.1.3, 7.24.4.1.1).

    The functions wcstod, wcstof and wcstold are not
    supported. The functions strtod, strtof and strtold do
    not set errno to ERANGE when and return 0 when underflow
    occurs.

  • Whether the calloc, malloc, and realloc functions return
    a null pointer or a pointer to an allocated object when the size
    requested is zero (7.20.3).

    The functions calloc, malloc and realloc functions all
    return a pointer to an allocated object when the size requested is
    zero.

  • Whether open streams with unwritten buffered data are flushed, open
    streams are closed, or temporary files are removed when the abort
    or _Exit function is called (7.20.4.1, 7.20.4.3, 7.20.4.4).

    When the abort function or _Exit function is called,
    temporary files are not removed, buffered files are not flushed and
    open streams are left open.

  • The termination status returned to the host environment by the
    abort, exit or _Exit function (7.20.3).

    The function abort causes a software exception to be raised. The
    termination status returned to the host environment by the functions
    exit and _Exit is determined by the execution environment.

  • The value returned by the system function when its argument is
    not a null pointer (7.20.4.6).

    This is determined by the execution environment.

  • The range and precision of times representable in clock_t and
    time_t (7.23.1).

    The precision of times representable in time_t is defined by the
    execution environment. time_t designates an unsigned long.
    The actual range of times representable by time_t is defined by
    the execution environment.

    The macro CLOCKS_PER_SEC is defined as 1000. clock_t
    designates an unsigned long.

  • The era for the clock function (7.23.2.1).

    The clock function always returns the value (clock_t)(-1) to
    indicate that the processor time used is not available.

  • The replacement string for the %Z specifier to the strftime
    and wcsftime functions in the "C" locale (7.23.3.5,
    7.24.5.1).

    The %Z specifier is replaced with the string “GMT”.

Locale-Specific Behavior

  • Additional members of the source and execution character sets beyond
    the basic character set (5.2.1).

    Both the source and execution character sets include all members of
    the ASCII character set.

  • The presence, meaning, and representation of additional multibyte
    characters in the execution character set beyond the basic character
    set (5.2.1.2).

    The execution character set does not contain multibyte characters.

  • The shift states used for the encoding of multibyte characters
    (5.2.1.2).

    The source and execution character sets does not contain multibyte
    characters.

  • The direction of writing of successive printing characters (5.2.2).

    Characters are printed from left to right.

  • The decimal-point character (7.1.1).

    The decimal-point character is ‘.‘.

  • The set of printing characters (7.4, 7.25.2).

    This is determined by the ASCII character set.

  • The set of control characters (7.4, 7.25.2).

    This is determined by the ASCII character set.

  • The set of characters tested for by the isalpha, isblank,
    islower, ispunct, isspace, isupper, iswalpha,
    iswblank, iswlower, iswpunct, iswspace, or
    iswupper functions (7.4.1.2, 7.4.1.3, 7.4.1.7, 7.4.1.9, 7.4.1.10,
    7.4.1.11, 7.25.2.1.2, 7.25.2.1.3, 7.25.2.1.7, 7.25.2.1.9,
    7.25.2.1.10, 7.25.2.1.11).

    The functions isblank, iswalpha, iswblank, iswlower,
    iswpunct, iswspace and iswupper are not supported.

    islower tests for the characters ‘a to ‘z‘. isupper
    tests for the characters ‘A‘ to ‘Z‘. isspace tests for
    the characters ‘ ‘, ‘\f‘, ‘\n‘, ‘\r‘, ‘\t‘ and
    \v‘. isalpha tests for upper and lower case characters.
    ispunct tests for all printable characters except space and
    alphanumeric characters.

  • The native environment (7.11.1.1).

    The native environment is the same as the minimal environment for C
    translation.

  • Additional subject sequences accepted by the numerical conversion
    functions (7.20.1, 7.24.4.1).

    No additional subject sequences are accepted by the numerical
    conversion functions.

  • The collation sequence of the execution character set (7.21.4.3,
    7.24.4.4.2).

    The comparison carried out by the function strcoll is identical
    to the comparison carried out by the function strcmp.

  • The contents of the error message strings set up by the strerror
    function (7.21.4.3, 7.24.4.4.2).

    The contents of the error message strings are given in
    Error message strings
    .

    Error message strings

    Value

    String

    EPERM

    Not owner

    ENOENT

    No such file or directory

    EINTR

    Interrupted system call

    EIO

    I/O error

    ENXIO

    No such device or address

    EBADF

    Bad file number

    EAGAIN

    No more processes

    ENOMEM

    Not enough space

    EACCES

    Permission denied

    EFAULT

    Bad address

    EBUSY

    Device or resource busy

    EEXIST

    File exists

    EXDEV

    Cross-device link

    ENODEV

    No such device

    ENOTDIR

    Not a directory

    EISDIR

    Is a directory

    EINVAL

    Invalid argument

    ENFILE

    Too many open files in system

    EMFILE

    Too many open files

    ETXTBSY

    Text file busy

    EFBIG

    File too large

    ENOSPC

    No space left on device

    ESPIPE

    Illegal seek

    EROFS

    Read-only file system

    EMLINK

    Too many links

    EPIPE

    Broken pipe

    EDOM

    Math argument

    ERANGE

    Result too large

    ENAMETOOLONG

    File or path name too long

    ENOSYS

    Function not implemented

    ENOTEMPTY

    Directory not empty

    ELOOP

    Too many symbolic links

  • Character classifications that are supported by the iswctype
    function (7.25.1).

    The character classifications supported by iswctype are given in
    Wide character mappings
    .

    Wide character mappings

    Value

    Description

    WCT_TOLOWER

    Convert to lower case

    WCT_TOUPPER

    Convert to upper case

Scroll to Top