Live data from Hacker News

The weirdest bug I’ve found in a compiler: MSVC 2017

medium.com

21–30 of 61 posts

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#21
post #20
post #17

Earlier quoted context omitted.

Sheesh, I'm not exactly obsessed with internet points but I am kinda curious why I got so downvoted. I wasn't really trying to be condescending, but the article kinda does answer this concern (regarding U being reserved) in a couple ways.

At risk of being downvoted, myself, as this is off-topic, but since there is no 'meta' and you're clearly looking to understand what happened, I suspect the issue originates in the first statement made from the original comment, which was posed in the form of a question: Didn't you read the rest of the article? My rule of thumb is that if a question can have ", moron?"[0] appended to it and both the meaning and tone…

Fair enough, I can just remove that sentence I suppose. ¯\_(ツ)_/¯

The internet is a fickle mistress.

edit: Nevermind, I can't. Guess the edit threshold is somewhere under 2 hours. Oh well.

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#22
post #21
post #20

Earlier quoted context omitted.

At risk of being downvoted, myself, as this is off-topic, but since there is no 'meta' and you're clearly looking to understand what happened, I suspect the issue originates in the first statement made from the original comment, which was posed in the form of a question: Didn't you read the rest of the article? My rule of thumb is that if a question can have ", moron?"[0] appended to it and both the meaning and tone…

Fair enough, I can just remove that sentence I suppose. ¯\_(ツ)_/¯ The internet is a fickle mistress. edit: Nevermind, I can't. Guess the edit threshold is somewhere under 2 hours. Oh well.

It's one hour. And deletions work until someone comments or one hour has passed.

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#23
post #12
post #11

Earlier quoted context omitted.

I know that’s a detail, but if I’m not mistaking the author is only one person, not sure why you wrote your comment in plural form (that personally slightly confused me).

I am a purveyor of singular they, lacking any other good gender-neutral way to refer to a singular person in English.

But in this case 'he' is a 'he' and that's clearly listed at the top of the article. So no need to be 'gender-neutral'.

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#24
post #18

I found years ago that (at least with older versions) VC++ implemented templates essentially as internally generated macros. All the non-standard behaviour they had could be explainined by considering how they would act if they were macros. This bug strikes me as being consistent with that. T is leaking across structs because it is internally #defined and seen by another struct. I think Microsoft has managed to prop…

I think as of 15.7, mentioned in TFA and released earlier this month, they do templates properly.

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#25
post #12

Earlier quoted context omitted.

I am a purveyor of singular they, lacking any other good gender-neutral way to refer to a singular person in English.

But in this case 'he' is a 'he' and that's clearly listed at the top of the article. So no need to be 'gender-neutral'.

I know I don't have to, but I do anyways; personal choice. First time anyone's really even pointed it out.

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#26
post #25

Earlier quoted context omitted.

But in this case 'he' is a 'he' and that's clearly listed at the top of the article. So no need to be 'gender-neutral'.

I know I don't have to, but I do anyways; personal choice. First time anyone's really even pointed it out.

I’m not a native English speaker myself, and I don’t live in a place with a majority of native speakers, so maybe that’s why. I got confused reading your comment as I thought that you were talking about something that I missed from the article (a link, or something else), thus I shared this feedback.

Though I’m not sure why people downvoted my comment. I haven’t expressed anything against the use of neutral pronouns (though that’s unexpected when the author is clearly a man). And I clearly specified that was a detail, not something to give importance to.

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#27
post #5

I tried remember reading an article on HN a couple of years ago about how MSVC got initial C++ support and added more and more features over time, despite having not being designed with C++ in mind originally. The result was a combination of clever hacks after clever hacks, with the consequence being the reputation MSVC got over time (I'm not saying this is one the consequence shown in the OP) Anyway, does anybody st…

Perhaps it was one of these two?

https://blogs.msdn.microsoft.com/vcblog/2017/09/11/two-phase...

https://blogs.msdn.microsoft.com/vcblog/2015/09/25/rejuvenat...

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#28
post #18

I found years ago that (at least with older versions) VC++ implemented templates essentially as internally generated macros. All the non-standard behaviour they had could be explainined by considering how they would act if they were macros. This bug strikes me as being consistent with that. T is leaking across structs because it is internally #defined and seen by another struct. I think Microsoft has managed to prop…

I just found this statement from Microsoft:

https://blogs.msdn.microsoft.com/vcblog/2017/09/11/two-phase...

"MSVC previously recorded the body of the template as a stream of tokens and stored that stream away to be replayed at instantiation time. The behavior of MSVC’s template substitution from a recorded token stream somewhat resembled the behavior of macro substitution in that limited analysis was done of a template’s body."

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#29
post #3

template using func_type = decltype(U{}.func()); I admit I'm not following all the new stuff that is added to C++. What are that two lines supposed to mean? I don't know what the U{}.func() and using x = decltype() constructs should mean or their names. The names of these and links highly appreciated. Thanks. Moreover, regarding the "bug": if "U" is actually special as an identifier (e.g. some predefined macro or som…

Using allows for type aliases like typedef but with a more readable syntax. Decltype will take the type of the expression within. So the U{} constructs a value of type U and then the func() is called. So func type will either be complete when the struct has a func member function or not. The void_t is always void but only if the template arguments are complete. So when func exists it will be a true type else a false type. True and false type are integral constants that have a constant value member

Re: The weirdest bug I’ve found in a compiler: MSVC 2017

#30
post #5

I tried remember reading an article on HN a couple of years ago about how MSVC got initial C++ support and added more and more features over time, despite having not being designed with C++ in mind originally. The result was a combination of clever hacks after clever hacks, with the consequence being the reputation MSVC got over time (I'm not saying this is one the consequence shown in the OP) Anyway, does anybody st…

I'm a two decade Windows developer so this isn't a "M$ Sucks" comment, but Windows itself is a series of hack on top of hack because Microsoft refuses to break backwards compatibility. As much as MS had the reputation of "Windows isn't done until Lotus won't run" back in the day. If you follow some of the MSDN blogs, you'll find the extraordinary hacks that MS has done over the years to keep the most obscure programs…

There’s a very good business in maintaining backwards compatibility. Any large enterprise is not going to buy from a company that they can’t rely on having a roadmap that will fix security issues but won’t break their deployed software.
Post reply on HN