Linus Torvalds writes: (Summary) wrote:
Looking at the code is definitely an option.
Looking at the code is definitely an option.
In fact, instead of depending on -Wvla, we could just make 'objtool' warn about real variable-sized stack frames.
warn about real variable-sized stack frames.
That said, if that "sizeof()" trick of Al's actually works with older gcc versions too (it *should*, but it's not like
__builtin_choose_expr() and __builtin_constant_p() have well-defined rules in the standard), that may just be the solution.
[...]
That is probably missing optimisation.Looking at the code is definitely an option.
Looking at the code is definitely an option.
In fact, instead of depending on -Wvla, we could just make 'objtool' warn about real variable-sized stack frames.
warn about real variable-sized stack frames.
That said, if that "sizeof()" trick of Al's actually works with older gcc versions too (it *should*, but it's not like
__builtin_choose_expr() and __builtin_constant_p() have well-defined rules in the standard), that may just be the solution.