Welcome to CRTL! This project attempts to provide a basic and portable implementation of an ANSI C runtime library. It is not the intention of this project to provide 100% of the ANSCI C RTL. The primary focus will be the most commonly used C library functions. So for example, C locale support is not planned at this time.
The unit tests in this project are linked only against the CRTL library. So all unit tests run and report results using this library and not the host OS libc implementation.
The CRTL project development and testing is mainly done on Windows and Mac OSX with Linux support as an additional goal. The primary architectures supported are x86, x64, and ARM64 but additional processors are candidates.
The file config.h contains defines to configure how the library is built.
This project has a small set of defined goals. These are:
- Provide implementations of the most common ANSI C runtime functions
- Prioritize correctness and portability
- Pursue performance where practical
- Support Windows, MacOS, Linux and bare CPU
There are also some explicit non-goals for the project. These are:
- Implement every single C runtime function
- Guarantee optimal performance, simple and small
- Support every OS / hardware configuration
There are several known/open issues at this time. Not all open issues are listed here, these are just some key examples.
- varargs and therefore syscall() on OSX x64 are not yet working
- Not all syscall() functions implemented
- printf() does not yet support float (%f) and a few other formats
A very simple test harness and a range of unit tests are included with the library. This enables quick validation of implementation across various platforms. Unit test coverage is growing but not yet complete.
This is primarily an educational exercise. I find that you really come to understand the C programming language and its library functions in a deep and meaningful way when you've actually done the work to implement the core library of functions.
At some point I also hope to be able to use this library with tiny C compilers that I write for microcontrollers that I use.
Contributions are welcome, particularly bug fixes and enhancements! Refer to our Contribution Guidelines for details.
Please note that Project owners reserve the right to accept or reject any PR for any reason.
Before contributing or participating to this community please be sure to familiarize yourself with our project CODE OF CONDUCT. These guidelines are intended to govern interactions with and within the community.
You may use this library with the understanding that doing so is AT YOUR OWN RISK. No warranty, express or implied, is made with regards to the fitness or safety of this code for any purpose.