XGC is a conforming free standing implementation of ANSI C as specified in Section 4 of the ANSI C Standard. This means there is no host environment and the means for starting a program, the effect of program termination and the library facilities are implementation defined.
The standard header files <float.h>, <limits.h>, <stdarg.h> and <stddef.h> are supported as defined by ANSI C.
The remaining standard header files <assert.h> , <ctype.h> , <errno.h> , <locale.h> , <math.h> , <setjmp.h>, <signal.h>, <stdio.h> , <stdlib.h> , <string.h> and <time.h> are also supported, but only to the extent that makes sense for a program running on an embedded target computer. In particular, the functions from <stdio.h> that work with files other than the standard files, are not supported.
The XGC run-time system and libraries comprise the following components:
The ANSI C header files.
The start file crt0.
The ANSI C library libc.a.
The ANSI C math library libm.a.
The POSIX Threads library libpthread.a.
Several implementation-defined header files and library functions.
The library is written in C, using assembly language where appropriate. Programs written in other languages, such as Ada 95 may also use the libraries by including the appropriate interface definitions or bindings.
The entry point is in the run-time system module crt0, which initializes the processor and the high level language environment before executing any static constructors and calling the application program main function.
The function main can be defined with no parameters, as follows:
Example 1-1. Function main
int main (void) { /* ... */ }
It may also be defined with two parameters referred to here as argc and argv, though any names may be used, as they are local to the function in which they are declared.
Example 1-2. Function main with arguments
int main (int argc, char *argv []) { /* ... */ }
The main function is always called with argc = 0. The value of argv is therefore undefined.