4 ms·
I see this idea posted with some frequency and the responses are almost always "clang and gcc have compiler intrinsics for this". I'm not a regular C programmer
by jzelinskie 6y ago
I see this idea posted with some frequency and the responses are almost always "clang and gcc have compiler intrinsics for this". I'm not a regular C programmer, so this begs the question: why is it that nobody seems to know or use them?
- saagarjha 6y agoThey’re nonstandard and not widely known. I suspect these are both correlated.
- jcelerier 6y agoif you have access to GCC and Clang then you also have access to C++ constructors / destructors... why would you bother with a non-standard attribute ? If you don't have access to gcc / clang because you're developing for some random board supported only by the Keil C compiler... then you don't have the feature anyways
- coldtea 6y agoI know several codebases that use them...
- rwmj 6y agoThey are fairly widely used in current software - most things that use glib require them, as well as systemd. They just need to be standardized.