Home     Blog    News    Ask a Question   

ARM C/C++ Compiler - Development Suite for ARM

The Crossware ARM C/C++ compiler generates code for the microprocessors and microcontrollers based on the ARM7, ARM9, Cortex-M3 and Cortex-M4 cores. It comes as part of the Crossware ARM Development Suite and runs under Windows 7 and above.


C Language Definition

The C compiler conforms to the 1989 ANSI C specification and in addition provides a number of general enhancements including:

It also supports a number of features from the 1999 ANSI C Standard including:

In addition, the compiler supports the C++ feature that allows variables to be defined within the conditional expressions of the for loop, while loop, if statement and switch statement

The support libraries are a subset of the ANSI standard libraries. The supported functions are listed below.

C++ Language Definition

The C++ compiler supports the Embedded C++ language. Embedded C++ is a subset of C++ specifically formulated for embedded systems. It is defined at http://www.caravan.net/ec2plus.

Embedded C++ excludes templates, exceptions, namespaces, run-time type information, localization, file operations and some other features.

Also Embedded C++ does not support multiple-inheritance and virtual base classes. However the Crossware compiler does support multiple-inheritance but does not support virtual base classes.

Since Embedded C++ does not support templates, basic_string is not supported. As an alternative, Embedded C++ provides the string class. The Crossware C++ library includes the string class.

The Crossware C++ library also includes the operators new, delete, new[], delete[], placement new and placement new[].

Other Embedded C++ library features such as streams and complex are not yet available in the Crossware library.

Data Sizes

The compiler uses the following sizes for the various C data types:

 char and unsigned char 1 byte
 short int and unsigned short int 2 bytes
 int and unsigned int 4 bytes
 long and unsigned long 4 bytes
 long long and unsigned long long 8 bytes
 float 4bytes (32 bits)
 double 8 bytes (64 bits)
 long double 8 bytes (64 bits)
 enum 4 bytes
 bit fields up to 32 bits


Optimizations include:

Function Calling Conventions

The compiler supports three calling conventions:

In-Line Assembler

Assembler code can be embedded in your C source code using two methods.

Strings inserted using the _asm keyword are scanned by the C preprocessor and so assembler statements can be generated using C macros with full macro token replacement. Additionally, the compiler can replace C variable names with the appropriate sub-string allowing easy access to global, static and local variables and parameters.

On the other hand, assembler macros are best defined outside of functions and the #asm/#endasm directive allows this.

Code and data location

Compiler generated code and data are automatically located in appropriate memory sections. Linker options allow these sections to be located at user defined memory locations. String constants and objects declared as const are located in code space. Initialised and uninitialised data are located in separate sections and initialisation of these sections is automatically carried out at run time.

Directives are also available allowing you to tell the compiler to place code and data in your own named sections. This gives you further control on where code and data are placed and how data space is initialised.

Linker scripting

The optional use of linker scripts adds more flexibilty to the location of sections and in particular allows the storage and run-time addresses to be different.

A unique drag-and-drop linker script editor simplifies the change to a linker script approach and eliminates the need for an understanding of the linker script language.

Optional section name translation enables the use of linker scripts written for other tool chains.

Source Code Browsing

The compiler optionally generates information on all of the definitions of and references to the identifiers used in your program. This includes functions, function parameters, local variables, global and static variables, enum identifiers, typedefs, goto labels and the tag names of structures, unions and enums. The Embedded Development Studio will then use this information to allow you to quickly navigate through your source code.

Debug Records

Comprehensive debug records are generated by the compiler and embedded in the object files for each module. The linker combines these to produce program wide debugging records.

C Library Routines

abs( ) coshl( ) gets( ) longjmp() sin( ) strrchr( )
acos( ) exit( ) getvect( ) ltoa() sinl( ) strspn( )
acosl( ) exp( ) gmtime() malloc( ) sinh( ) strstr( )
alloca() expl( ) isalnum( ) memchr( ) sinhl( ) tan( )
asctime() fabs( ) isalpha( ) memcmp( ) sprintf( )tanl( )
asin( ) fabsl( ) isascii( ) memcpy( ) sqrt( ) tanh( )
asinl( ) _fcvt( ) iscntrl( ) memmove( )sqrtl( ) tanhl( )
atan( ) ferroe( ) isdigit( ) memset( ) srand( ) time( )
atanl( ) fgetc( ) isgraph( ) mktime() sscanf( ) toascii( )
atoi( ) fgets( ) islower( ) pow( ) strcat( ) tolower( )
atol( ) fileno( ) isprint( ) powl( ) sscanf( ) toupper( )
atoff( ) floor( ) ispuntc( ) printf( ) strchr( ) ultoa()
atolf( ) floorl( ) isspace( ) putc( ) strcmp( ) ungetc( )
calloc() fprintf( )isupper( ) putchar( )strcpy( ) ungetch( )
clearerr( )fputc() isxdigit( )puts( ) strcspn( )vfprintf()
ceil( ) fputs() labs( ) qsort() stricmp() vprintf()
ceill( ) free( ) ldexp() rand( ) strlen( ) vsprintf()
clock() fscanf( ) log( ) sbrk( ) strncat( )
cos( ) getc( ) logl( ) scanf( ) strncmp( )
cosl( ) getchar( )log10( ) setjmp() strncpy( )
cosh( ) getche( ) log10l( ) setvect( )strpbrk( )