A super-lightweight libc clone.
SimpleC is a super-lightweight, fast-compiling, freestanding libc clone for C development, targeted to mostly devs looking for a libc alternative.
SimpleC is super-lightweight. A simple program thats uses SimpleC with -static and -nostdlib is under 10KB!
SimpleC is super-lightweight so it compiles super-fast because there is no fluff compared to libc.
SimpleC acts pretty much like libc. You probably can't see a difference.
SimpleC is super-easy to import, just copy the .h file(s) to your current directory. Then just import them like this:
#include "<filename>.h"Warning
When using SimpleC with the flag -nostdlib, there is a bug that where if you don't exit after a function, it will give a segmentation fault. To avoid this, you can simply use the exit() function by including the stdlib header like this:
#include "stdlib.h"
void _start() {
// Your code here...
exit(0);
}Tip
When compiling, if you are getting a bunch of warnings like this:
warning: conflicting types for built-in function ‘pow’; expected ‘double(double, double)’ [-Wbuiltin-declaration-mismatch]
You can use the -fno-builtin flag in GCC so you can avoid these warnings. Like this:
gcc -static -fno-builtin example.c -o example