Article View: comp.std.c
Article #212Re: Intermediate addr outside object: legal?
From: Norman Diamond
Date: Tue, 14 Apr 1992 01:57
Date: Tue, 14 Apr 1992 01:57
41 lines
2971 bytes
2971 bytes
In article <2160003@aspen.IAG.HP.COM> shankar@aspen.IAG.HP.COM (Shankar Unni) writes: >In comp.std.c, barmar@think.com (Barry Margolin) writes: >>In article <2160002@aspen.IAG.HP.COM> shankar@aspen.IAG.HP.COM (Shankar Unni) writes: >>>This, of course, does not address the question of what is "the right >>>thing to do" when the compiler sees this expression (the user- >>>friendliness question). Is it reasonable for the program to get a >>>SIGSEGV on this? I.e. is this some sort of commonly used (albeit >>>questionable) idiom in some context that I'm not aware of? >> >>It depends on what you mean by "user-friendliness". Which is more >>friendly: warning the programmer that their program may not port easily, or >>doing what the programmer probably expects? > >Well, I might as well come out and say it: this case came up when >someone trying to optimize TeX 3.14 ran across it. Apparently Web2C >(which translates the original TeX web code into C) puts out code like >this, and from the message I got, it did so all over the place. Which is >why I was asking : is this a peculiarity of Web2C, or do other programs >also do this sort of junk? The question of user-friendliness is not a comp.std.c topic, except when a revised standard is being developed and there are proposals for the standard to ALLOW user-friendly conforming implementations. The question of whether the present standard ALLOWS SIGSEGV for violations is suitable and has a perfectly clear answer. Yes. And as rationale, it has already been pointed out why it is reasonable to allow this behavior, since it would be expected on some reasonable architectures. The last question also is not particularly a comp.std.c topic, but it does arise and cause repercussions all too frequently. The answer to this too is yes, there is a lot of broken code out there. Mr. Margolin pointed out that some programmers find it more friendly to be warned when their code is broken. I agree. But Mr. Margolin and I seem to be in the minority. It is a fact of life that many programmers have preferred writing broken code, are writing broken code now, and will continue writing broken code forever more. -- Norman Diamond diamond@jit081.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it. "Yeah -- bad wiring. That was probably it. Very bad."
Technical Details
Message-ID:
<1992Apr14.015713.24113@jrd.dec.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!decuac!pa.dec.com!jrdzzz.jrd.dec.com!jit345.bad.jit.dec.com!diamondReferences:
<2160001@aspen.IAG.HP.COM> <2160003@aspen.IAG.HP.COM>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!decuac!pa.dec.com!jrdzzz.jrd.dec.com!jit345.bad.jit.dec.com!diamond From: diamond@jit345.bad.jit.dec.com (Norman Diamond) Subject: Re: Intermediate addr outside object: legal? Message-ID: <1992Apr14.015713.24113@jrd.dec.com> Sender: usenet@jrd.dec.com (USENET ACCOUNT) Nntp-Posting-Host: jit345 Reply-To: diamond@jit.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo References: <2160001@aspen.IAG.HP.COM> <2160003@aspen.IAG.HP.COM> Date: Tue, 14 Apr 92 01:57:13 GMT Lines: 41