Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.lang.c Subject: Re: register variable??? Message-ID: <1136@virtech.UUCP> Date: 9 Sep 89 00:16:09 GMT References: <30585@srcsip.UUCP> Organization: Virtual Technologies Inc Lines: 15 In article <30585@srcsip.UUCP>, sklee@pompeii.SRC.Honeywell.COM (Sungkee Lee) writes: > printf("list = %d %d %d %d %d\n", > list[0], list[1], list[2], list[3], list[4]); > i = 0; > while (i < 4) list[i] = list[++i]; ^^^^^^^^^^^^^^^^^^^^ This is an undefined operation due to the use of i on both sides with an auto increment on the right. There is no definition of the value of i on the left and that value may change due to the declaration of i as a register type or a non-register. > Is this the way register variable is designed? > Or, is this compiler error? I ran this program on Sun 3/60? It is neither. It is a problem with the code.