Xref: csiph.com comp.arch:33267 Newsgroups: comp.arch Path: csiph.com!xmission!news.snarked.org!news.exile.org!news.kjsl.com!usenet.stanford.edu!kithrup.com!mrs From: mrs@kithrup.com (Mike Stump) Subject: Re: The freedom that give us C++ and C Message-ID: Date: Fri, 29 Jan 2016 03:42:06 GMT References: <9c80cae7-494e-41ed-b2eb-3eff523719f9@googlegroups.com> Organization: Kithrup Enterprises, Ld. X-Newsreader: trn 4.0-test77 (Sep 1, 2010) In article <9c80cae7-494e-41ed-b2eb-3eff523719f9@googlegroups.com>, Bruce Hoult wrote: >On Tuesday, January 26, 2016 at 5:00:03 AM UTC+3, Mike Stump wrote: >> >Because you can't write a useful C program without relying on "undefined >> >behavior". >> >> While maybe you can't, that deficiency is your, not mine. I can write >> one just fine. > >I seem to see this claim and counter-claim a lot. It feels like something that should be able to be tested. Sure. gcc, existance proof. QED. Next. The problem is, if you found one, we would just take a minute and fix it, then there would be none. It isn't that gcc is bug free, it isn't;; but that we can, and do fix bugs. It comes down to, would a patch be rejected that removed undefined behavior from the code base. In all my years, I don't recall any such rejection, ever. And at the very edge of state of the art, if there were something bleeding edge, we would merely document it in the manual, make the behavior fully defined and _continue_ using it. Net effect, you _still_ loose. We can do this, because we would put that code inside an #ifdef GCC, and in the #else portion we would put in the crappy slow version. Or, if you want, ask around, ask, would you reject a patch to fix an undefined behavior bug in your code base? Let me know how many projects you poll, and what their answers were. For those that say yes, feel free to name them.