beautypg.com

Supported new features from the 1999 standard, Type sizes, C++ style comments – Zilog ZUSBOPTS User Manual

Page 197: Trailing comma in enum, Empty macro arguments, Long long int type

background image

UM017105-0511

Type Sizes

Zilog Developer Studio II – ZNEO™

User Manual

169

Supported New Features from the 1999 Standard

The ZNEO compiler implements four new features introduced in the ANSI 1999 standard,
also known as ISO/IEC 9899:1999; each is described below.

C++ Style Comments

Comments preceded by

//

and terminated by the end of a line, as in C++, are supported.

Trailing Comma in Enum

A trailing comma in

enum

declarations is allowed. This essentially allows a common syn-

tactic error that does no harm. Thus, a declaration such as:

enum color {red, green, blue,} col;

is allowed (note the extra comma after

blue

).

Empty Macro Arguments

Preprocessor macros that take arguments are allowed to be invoked with one or more
arguments empty, as in this example:

#define cat3(a,b,c) a b c

printf("%s\n", cat3("Hello ", ,"World"));

// ^ Empty arg

Long Long Int Type

The

long long int

type is allowed. (In the ZNEO C-Compiler, this type is treated as

the same as

long

, which is allowed by the standard.)

Type Sizes

The type sizes for basic data types on the ZNEO C-Compiler are:

The type sizes for the pointer data types on the ZNEO C-Compiler are:

int

32 bits

short int

16 bits

char

8 bits

long

32 bits

float

32 bits

double

32 bits

This manual is related to the following products: