part of c programming
direct literal initialization of dynamically allocated arrays
int* a = malloc(3 * sizeof(int)); a = {1, 2, 3}; is invalidkeyword arguments
parametric array types
typedef int a3[3]; works for fixed lengthlocal symbolic bindings
reflection and type inference
_Generic gives limited compile-time dispatchtypeof is nonstandardportable include guard primitive
#ifndef/#define pattern is standard#pragma once is widespread but nonstandardanonymous functions
variadics
type metadata: each argument should carry its real type and size so the callee can validate or cast correctly.
count metadata: the callee should know how many arguments exist.
consistent layout: arguments stored in a contiguous, well-defined block so they can be iterated or copied safely.
statictypical workarounds
static for internal linkagevariadics and repetition
__VA_COUNT__ (portable argument count)for_each, map, with separator control__VA_OPT__ everywhere, including nested use (c23 defines it; clarify nesting)structure-aware matching
(...) [...] {...}macro scoping and hygiene
unique_id)do { } while (0) idiomdirectives and phase control
#include)no-expand markerintrospection and diagnostics
is-defined and equalsis_macro(name), macro_arity(name)#errorf with location info