Thread View: net.lang.c
1 messages
1 total messages
Started by H. Munster
Fri, 07 Nov 1986 18:24
Not only that, but...
Author: H. Munster
Date: Fri, 07 Nov 1986 18:24
Date: Fri, 07 Nov 1986 18:24
29 lines
1759 bytes
1759 bytes
In article <630@dg_rtp.UUCP>, throopw@dg_rtp.UUCP (Wayne Throop) types:
>Again folks, play it safe: *NEVER* have two side-effects on a single
>object in a single expression.
Not only that, but: don't even *USE* an assigned-to object anywhere else
in the expression!
An example, given by K&R on p. 50:
a[i] = i++;
What is the value of i in the subscript? Who knows? Keep in mind this quote
from the same page: "When side effects (assignment to actual variables) takes
place is left to the discretion of the compiler, since the best order strongly
depends on machine architecture." I interpret this to mean that the assign-
ment doesn't have to be done *anywhere* within the statement...in fact, it
doesn't have to be done until just before the variable is referenced again!
---
It's been said by many a wise philosopher that when you die and your soul
goes to its final resting place, it has to make a connection in Atlanta.
Dave Cornutt, Gould Computer Systems, Ft. Lauderdale, FL
UUCP: ...{sun,pur-ee,brl-bmd}!gould!dcornutt
or ...!ucf-cs!novavax!houligan!dcornutt
ARPA: wait a minute, I've almost got it...
"The opinions expressed herein are not necessarily those of my employer,
not necessarily mine, and probably not necessary."
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads