You consider it fine that positional parameters take quadratic time?
-
-
-
Hm? They don't in musl.
-
How do you do unlimited positional parameters without memory allocation below quadratic time? You would have to start over the va_arg.
-
It's not unlimited. The limit is finite and allowed to be as low as 9. O(9²) is O(1).
-
Bug without unlimited storage, unlimited positional args are at least cubic, not quadratic. O(strlen(fmt)*nargs²).
-
Does Musl have a limit?
-
Yes, 9. It doesn't cubic rescan. It has a [9] array.
-
I like that. Has this ever been a compatibility problem? What does other implementations do?
- 1 more reply
New conversation -
-
-
one time on an embedded system I got burned by a non-malloc printf that used a lot more stack space than I thought it would
-
took like two days to debug since I didn't know anything at the time
-
course I'd have been even more screwed if it malloced since this system had no heap
-
It would be nice to publish worst case stack usages of libc functions, or promises that all libc functions work with at least this space.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.