inline functions as good as templates
I recently started to implement parts of the “Bounds checking interfaces” of C11 (Annex K) for P99 and observed a nice property of my implementation of qsort_s. Since for P99 basically all functions...
View ArticleDemystify undefined behavior
In discussions about C or other standards (e.g POSIX) you may often have come across the term undefined behavior, UB for short. Unfortunately this term is sometimes mystified and even used to scare...
View ArticleEffective types and aliasing
I already have posted about the evilness of cast some time ago, but recently I have seen that there is still much confusion out there about the C rules that pointer casts, also called type punning,...
View Articlegcc doesn’t inline position independent code properly
When compiling position independent code, PIC, the gcc compiler fails to inline many functions that have an external name, that is that are not declared static. While this is conforming to the C...
View Article