It would be nice if there were annotations to _why_ the UBs were made.
-
-
Motivation seems clear: allowing compiler to be written portably using stdio text mode.
2 replies 0 retweets 1 like -
but as always, when there is a choice of acceptable behaviors, the right answer is to make it implementation-defined
1 reply 0 retweets 1 like -
Well the compiler itself would have undefined behavior if it's written in C and it reads in text mode a file that's not a text file. :-)
1 reply 0 retweets 0 likes -
Replying to @RichFelker @johnregehr and
To make it implementation-defined, you'd be mandating that the compiler has to handle this case, which can't be done portably in C.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @johnregehr and
Thus you'd be precluding writing the C compiler in portable C.
3 replies 0 retweets 0 likes -
Replying to @RichFelker @johnregehr and
I didn't think a C compiler _could_ be written in portable C thanks the stdarg.h hell and offsetof()?
3 replies 0 retweets 1 like -
Replying to @cr1901 @johnregehr and
You're confusing writing the compiler in portable C with writing headers that work on an arbitrary compiler.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @johnregehr and
But the stdarg.h header _has_ to be implemented in some form to be compliant. I _suppose_ I could embed stdarg.h into the compiler itself >>
2 replies 0 retweets 0 likes -
Replying to @cr1901 @RichFelker and
tho; nothing in the standard prevents it, and it sidesteps the issue of having to parse code that cannot be represented in C.
1 reply 0 retweets 0 likes
Rich Felker Retweeted Rich Felker
You've confused about something at a very fundamental level here. Seehttps://twitter.com/RichFelker/status/925401531826016256 …
Rich Felker added,
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.