There is a very common misunderstanding about the
inline keyword in C99. Rumors go that this would just be a useless hint to the compiler, that generation of external symbols or not is left to the compiler implementor, that this is some bizarre take over from C++ or whatever.
None of that is completely correct.
P99 – Preprocessor macros and functions for C99
P99 is a toolbox of macro and function definitions that ease the programming in modern C, aka C99. By using new tools from C99 it implements default arguments for functions, scope bound resource management, transparent allocation and initialization, …
The complexity of the tools ranges from very simple (but convenient) macros such as P99_INIT to relatively complex ones such as P99_UNWIND_PROTECT.
P99 is not a library but just a set of include files. You may include the whole by just using “p99.h” or cherry pick individual parts to your needs. You will not have to link against a special library the “only” prerequisite is that your compiler supports modern C, aka C99, to a wide extent.
So far I have tested P99
- on linux systems
- with INTEL 32 / 64 bit and ARM processors
- with four different compilers:
- with code from an internal project.
If you are developing for another setting I would be very much curious to hear of your experience with P99.
P99 can be downloaded at p99.gforge.inria.fr. It is licensed under the QPL.
I always thought that using
NULL whenever I wanted to assign a null pointer value to a pointer was a good thing, but today I learned the contrary.