fixing this (in recent C++) did not exactly require a stroke of geniuspic.twitter.com/AxsDamkQfS
আপনি আপনার টুইটগুলিতে ওয়েব থেকে এবং তৃতীয়-পক্ষ অ্যাপ্লিকেশনগুলির মাধ্যমে অবস্থান তথ্য যেমন শহর বা সুনির্দিষ্ট অবস্থান যোগ করতে পারবেন। আপনার কাছে আপনার টুইটের অবস্থান ইতিহাস মোছার বিকল্প থাকবে। আরও জানুন
fixing this (in recent C++) did not exactly require a stroke of geniuspic.twitter.com/AxsDamkQfS
OTOH unlike most other UB, it's totally harmless in practice.(Or is it? What does gcc do when linking an empty file? Do I want to find out?)
there's a whole pile of these, at least 100, that all should be fixed as "mandatory fatal diagnostic" or whatever
Your screenshot has a reference to exactly where in the standard this is defined and it's a part of the Posix description of text files.
this is from Appendix J.2, which starts "The behavior is undefined in the following circumstances:"
Note the normative wording for C11 is in section 5.1.1.2 paragraph 2pic.twitter.com/ch2jHWEspO
thanks I hadn't taken the time to find that part
No worries, I know some items in J.2 can not be nailed down to normative wording and I was curious to check out this case.
Basically all UB in translation phases 1-5 is licensing historic preprocessors to not bother diagnosing errors.
right, a license that is probably never exercised anymore
I know I made GCC 3.0’s preproc diagnose as many of them as I could
It would be nice if there were annotations to _why_ the UBs were made.
well, some of that can be found here: http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf … and some more here: http://www.coding-guidelines.com/cbook/cbook1_2.pdf …
For C++ the closest equivalent to the C99 rationale is "The Annotated C++ Reference Manual"(ARM) http://www.stroustrup.com/arm.html published in 1990!
Woefully out of date but there are still some gems in there I can use for SO answers today e.g. probably my favorite https://stackoverflow.com/a/30791078/1708801 …pic.twitter.com/bQXddXb7vT
How's this handled by various compilers? I may regret this hasty assessment but doesn't seem super hard to detect/abort with clean error?
Both clang and gcc act as if a newline was there.
I remember reading this when I implemented my preprocessor. Most, if not all, of the UB in the PP is there because of lazyness. They're all easily avoided, and could be defined. Apparently, though, they couldn't be bothered.
টুইটার তার ক্ষমতার বাইরে চলে গেছে বা কোনো সাময়িক সমস্যার সম্মুখীন হয়েছে আবার চেষ্টা করুন বা আরও তথ্যের জন্য টুইটারের স্থিতি দেখুন।