Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!lll-winken!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!unmvax!bbx!bbxsda!scott From: scott@bbxsda.UUCP (Scott Amspoker) Newsgroups: comp.lang.c Subject: Re: Compilers and programming style (was Re: A question of style) Message-ID: <540@bbxsda.UUCP> Date: 10 Jan 90 16:04:12 GMT References: <1989Dec22.100135.2903@gdt.bath.ac.uk> <4367@rtech.rtech.com> <1989Dec31.153241.16479@gdt.bath.ac.uk> <649@codonics.COM> <1990Jan5.100042.26760@gdt.bath.ac.uk> <2283@dataio.Data-IO.COM> <534@bbxsda.UUCP> <28716@amdcad.AMD.COM> Reply-To: scott@bbxsda.UUCP (Scott Amspoker) Organization: Basis International, Albuquerque, NM Lines: 19 In article <28716@amdcad.AMD.COM> tim@amd.com (Tim Olson) writes: >In article <534@bbxsda.UUCP> scott@bbxsda.UUCP (Scott Amspoker) writes: >| In article <2283@dataio.Data-IO.COM> bright@dataio.Data-IO.COM (Walter Bright) writes: >| >volatile int *p; >| >*p; /* has side effects and must not be optimized away */ >| >| Just curious - what kind of code should be generated for the above >| C fragment? > >The integer pointed to by p should be accessed from memory and thrown >away (this may be useful in talking to certain peripheral devices). By "should" I assume you mean that this is in the ANSI specification? -- Scott Amspoker Basis International, Albuquerque, NM (505) 345-5232 unmvax.cs.unm.edu!bbx!bbxsda!scott