Oh, and after actually reading the manual description of the -Walloc-size-larger-than= option, I see the problem with the new expression. NEED is signed and not checked to ensure that it is always greater than 0, so could be -1, which when cast to size_t would be greater than SIZE_MAX / 2. I'm surprised this is the only warning we see about that kind of issue in Octave.

> Character variables longer than HUGE(0) elements are now possible on 64-bit targets. Note that this changes the procedure call ABI for all procedures with character arguments on 64-bit targets, as the type of the hidden character length argument has changed. The hidden character length argument is now of type INTEGER(C_SIZE_T).