I don't see where this would be required. size_t is defined via sizeof.
-
-
Specification of lib functions. E.g. strlen is specified to return length, not "length, converted to size_t".
1 reply 0 retweets 0 likes -
If you want to just say it's UB or unspecified result if it doesn't fit, that's even more awful and unusable.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @gustedt
Sure it's UB. In the same way as printf of >INT_MAX chars.
1 reply 0 retweets 0 likes -
Only way you can claim it's UB is by omission of a clear statement what happens. In any case, unusably bad impl.
1 reply 0 retweets 1 like -
This is very different from printf >INT_MAX, since there's no conceptual upper bound on printf output length.
2 replies 0 retweets 0 likes -
Replying to @RichFelker @gustedt
If you limit width/precision then I think SIZE_MAX * SIZE_MAX should work as an upper bound.
1 reply 0 retweets 0 likes -
The standard doesn't limit them, though. So printf("%999999999999999999999999999999999999999999999999999999d",0)
1 reply 0 retweets 0 likes -
My point here is that the standard is full of omissions of necessary explicit requirements or error conditions.
1 reply 0 retweets 0 likes -
It's a willfully buggy/incomplete standard by a committee who thinks "you know what we meant!" suffices...
2 replies 0 retweets 0 likes
Interpreting that into something without gratuitous severe usability flaws is left to the reader. :-(
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.