Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!ames!elroy!cit-vax!oberon!skat.usc.edu!blarson From: blarson@skat.usc.edu (Bob Larson) Newsgroups: comp.lang.c Subject: Re: comma operator Message-ID: <6390@oberon.USC.EDU> Date: 22 Jan 88 06:09:13 GMT References: <3819@sigi.Colorado.EDU> <8599@ism780c.UUCP> <1866@bsu-cs.UUCP> <4006@june.cs.washington.edu> <3586@sdcc6.ucsd.EDU> <4018@june.cs.washington.edu> <2427@bloom-beacon.MIT.EDU> <4037@june.cs.washington.edu> Sender: nobody@oberon.USC.EDU Reply-To: blarson@skat.usc.edu (Bob Larson) Organization: USC AIS, Los Angeles Lines: 24 In article <4037@june.cs.washington.edu> pardo@uw-june.UUCP (David Keppel) writes: > int *ctrl_p = DISK_CTRL_REGISTER; > int *out_p = DISK_OUT_REGISTER; > > *ctrl_p = SETUP, *out_p = GO; > >which _relies_ on the evaluation order being guaranteed in a >stronger way than is provided by sequence points. Ansi C (all recent drafts, not yet a standard) adds the keyword "volitile" for exactly this reason. Change the declarations to int *volitile ctrl_p; int *volitile out_p; and an ANSI compiler will not be allowed to rearange. (I got this out of this group, I hope I have the volitile in the right place.) -- Bob Larson Arpa: Blarson@Ecla.Usc.Edu blarson@skat.usc.edu Uucp: {sdcrdcf,cit-vax}!oberon!skat!blarson Prime mailing list: info-prime-request%fns1@ecla.usc.edu oberon!fns1!info-prime-request