home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.gcc.bug
- Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tis.llnl.gov!carlson
- From: carlson@tis.llnl.gov (John Carlson)
- Subject: Increment and assignment (sleepy programmers see section 3.1 of C FAQ)
- Message-ID: <135161@lll-winken.LLNL.GOV>
- Sender: gnulists@ai.mit.edu
- Organization: Lawrence Livermore National Laboratory
- Distribution: gnu
- Date: Wed, 2 Sep 1992 10:38:37 GMT
- Approved: bug-gcc@prep.ai.mit.edu
- Lines: 19
-
- int i = 0;
- i = i++;
- printf("%d\n", i);
-
- Values of i:
-
- Sun 4.1.1 cc compiler produces: 1
- Sun C++ 2.1 produces: 1
- Optimized gcc produces: 1
- Unoptimized gcc 2.2.2 produces: 0
- AT&T cc compiler produces: 0
-
- Don't use i = i++.
-
- It would be nice if the compiler warned me about it.
-
- John Carlson
- carlson@yottzumm.tis.llnl.gov
-
-