This repo implements type checking in C with _Generic
.
- A recent C compiler that supports C11, which is mandatory for
_Generic
. - (Optional)
make
: for system-wise installation. - (Dev) Cppcheck: for static code analysis.
- (Dev) Valgrind: for memory leak detection.
- (Dev) Perl: for tailing-line space trimming.
We tested this program on recent GCC and Clang.
Just copy type_check.h to your project.
For system-wise installation, run make install
:
$ PREFIX=/usr/local sudo make install
This program provides two macros:
type(t)
emits a type-presenting enum.type_str(t)
emits a type-presenting C string.
View the test program for more usage.
Michae Chen, 2018.
MIT