News for hackers. Stuff that matters.
Re:Some obscure C features by nialv7 on Thursday January 25, 2018 @07:11PM (#16235996)
There's a simple solution you're missing here:

__attribute__((constructor))

Re:Some obscure C features by kbob on Thursday January 25, 2018 @07:53PM (#16236204)
This is what I came to say. Here is a working example that builds an array of function pointers at program initialization time.

https://github.com/kbob/schetoo/blob/master/prim.h#L215

This also works across multiple source files, unlike __COUNTER__.