When an inline function definition contains a static local variable that has its address taken, space is allocated for this variable, even if no code is emitted for the inline function. I.e. this file
extern void *m (void *p);
inline void l(void) {static unsigned char v; m (&v);}
Compiles into:
.area DSEG (DATA)
_l_v_10000_3:
.ds 1
For ports, where --stack-auto is not the default, this also affects variables not declared static. This is a serious issue for those ports, as just including a header with some inline functions can easily result in running out of RAM.
There is a partial fix in [r15645], that works for the example above (and the rotation functions from stdbit.h), but is not enough for some others (in particular the endian-aware load functions from stdbit.h).
Related
Commit: [r15645]
Last edit: Philipp Klaus Krause 2025-09-02
Fixed in [r15646].
Related
Commit: [r15646]