From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: jmk@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] how to avoid a memset() optimization MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Thu, 14 Nov 2002 13:55:06 -0500 Topicbox-Message-UUID: 205f9ea4-eacb-11e9-9e20-41e7f4b1d025 On Thu Nov 14 13:32:18 EST 2002, tad@entrisphere.com wrote: > > someone mentioned something along the lines of > > void* > secmemset(void *buf, int v, int len) > { > return memset((volatile void*)buf, v, len); > } > > However, isn't GCC going to complain that you're passing > a volatile to a function that isn't expecting a volatile? > > -Tad Jarring chord. The door flies open and Cardinal Ximinez of Spain enters flanked by two junior cardinals. Cardinal Biggles has goggles pushed over his forehead. Cardinal Fang is just Cardinal Fang. Ximinez: Nobody expects the Volatile Inquisition. Our chief weapon is surprise that your code doesn't work ... surprise and fear that you forgot an optimisation parameter... fear and surprise ... our two weapons are fear and surprise ... and ruthless efficiency instead of correctness. Our THREE weapons are fear, surprise and ruthless efficiency and an almost fanatical devotion to RMS ... Our FOUR ... no ... AMONGST our weaponry are such elements as fear, surprise ... I'll come in again. (exit and exeunt)