Post #1892859
2026-05-02 14:58 UTC
@poliorcetics@social.treehouse.systems the magic is in the identifier after the default and after the int in the _Generic: it allows you to take an ident on the value put into a C _Generic expression so you don't have to keep re-computing the value to use it in the branches. It also gives safe type checking.
Replies (2)
-
@alison@burningboard.net 2026-05-02 20:24
@thephd@pony.social @poliorcetics@social.treehouse.systems Is __Generic already part of C? I always enjoyed seeing more of the internal in GDB: (gdb) p *process_secondary_params $1 = {_Bool (struct parser_props *, char *)} 0x3523a
-
@poliorcetics@social.treehouse.systems 2026-05-02 15:00
@thephd ohhh it’s a typed switch/case or match! Very cool indeed