Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: A question on volatile accesses Message-ID: <14327@smoke.brl.mil> Date: 4 Nov 90 05:07:01 GMT References: <2388@lupine.NCD.COM> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 18 In article <2388@lupine.NCD.COM> rfg@lupine.ncd.com (Ron Guilmette) writes: > volatile int *ip; > i = *++ip; >In other words, could the program above legally be treated as: > volatile int *ip; > i = *ip; > ++ip; "volatile" has nothing to do with this. The above rewrite would be incorrect in any case. Better would be volatile int *ip; i = ip[1]; ++ip; The only places in the code where side effects are required to be brought up to date (synchronized) are at sequence points, such as at the end of the assignment statement in the original code.