home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!world!ksr!jfw
- From: jfw@ksr.com (John F. Woods)
- Newsgroups: comp.lang.c
- Subject: Re: Question to test general C knowledge
- Message-ID: <20354@ksr.com>
- Date: 22 Dec 92 14:36:52 EST
- References: <19980@ksr.com> <PTmLVB4w165w@quest.UUCP> <1992Dec11.175620.20308@crd.ge.com> <1992Dec12.224541.29854@thunder.mcrcim.mcgill.edu> <1992Dec13.045828.1714@crd.ge.com> <1992Dec14.150401.1283@cae.prds.cdx.mot.com> <1992Dec15.144244.3559@crd.ge.com>
- Sender: news@ksr.com
- Lines: 28
-
- volpe@bart.NoSubdomain.NoDomain (Christopher R Volpe) writes:
- >No, you're missing the point. Real compilers don't go out of their way
- >to take advantage of undefined behavior and cause trouble.
-
- Real compilers often cause trouble without going out of their way.
- Real good programmers don't go out of their way to take advantage of
- undefined behavior just because all six copies of Microsoft C give the
- same results.
-
-
- >However, I also raised an issue concerning
- >whether or not the expression *really* violates the shall-rule in
- >3.3, and that depends on the definition of the term "modify" as used
- >in section 3.3. As far as I can tell, no one has commented on that issue
- >yet.
-
- I asked Doug Gwyn. He concurred that "x = ++x;" falls under the restriction;
- "modify" does not mean "changed" in that context, just as it does not in
- several other contexts in the standard:
-
- const int i = 4;
- int *ip = (int *)&i;
-
- *ip = 4;
-
- I hope you agree that this is undefined. Doug is not the ANSI Committee, of
- course, so if you want a definitive ruling, you can submit an RFI.
-
-