Article View: comp.std.c
Article #4174Re: Union access
From: Christopher R. Volpe
Date: Wed, 04 Oct 1995 13:34
Date: Wed, 04 Oct 1995 13:34
28 lines
1816 bytes
1816 bytes
In article <44u0jm$9pr@lyra.csx.cam.ac.uk>, nmm1@cus.cam.ac.uk (Nick Maclaren) writes: > >When talking on C, I use a related construction as an example of something >that is simultaneously illegal and required to work. I.e. a conforming >compiler may reject the program but, if it fails to detect the error, the >compiled code must execute correctly. I have a hard time understanding this. If the code is "illegal" in the sense of requiring a diagnostic, then a conforming compiler MUST detect and diagnose the error. If it doesn't, then it isn't a conforming compiler, and all bets as to what the resulting code must do are off. Even if it detects the error, and generates code, how can you justify any claim about what illegal code "must" do? > >There is actually some dissent about this. Some people hold the view that >implementation-defined behaviour allows the compiler writer to say "if you >use this construction, you will get no error message and your program will >go bananas." This is clearly not what the ANSI committee intended compiler >writers to do :-) Correct, but what exactly is implementation defined in the example you gave? -- Chris Volpe Phone: (518) 387-7766 (Dial Comm 8*833 GE Corporate R&D Fax: (518) 387-6560 PO Box 8, Schenectady, NY 12301 Email: volpecr@crd.ge.com
Technical Details
Message-ID:
<44u2h1$362@rdsunx.crd.ge.com>Path:
arc1-ca.pugleaf.net!bart.crd.ge.com!volpeReferences:
<812736828snz@soliton.demon.co.uk> <44u0jm$9pr@lyra.csx.cam.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!bart.crd.ge.com!volpe From: volpe@bart.crd.ge.com (Christopher R. Volpe) Newsgroups: comp.std.c Subject: Re: Union access Date: 4 Oct 1995 13:34:25 GMT Organization: GE Corporate Research & Development Sender: volpe@bart (Christopher R. Volpe) Distribution: world Message-ID: <44u2h1$362@rdsunx.crd.ge.com> References: <812736828snz@soliton.demon.co.uk> <44u0jm$9pr@lyra.csx.cam.ac.uk> Reply-To: volpe@ausable.crd.ge.com NNTP-Posting-Host: bart.crd.ge.com