From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 15 Nov 2002 11:51:50 -0500 From: William Josephson To: 9fans@cse.psu.edu Subject: Re: [9fans] how to avoid a memset() optimization Message-ID: <20021115165150.GA4088@mero.morphisms.net> References: <38aa463bafe23035decff6b0364f7553@plan9.bell-labs.com> <3DD42123.B0AC73C0@null.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DD42123.B0AC73C0@null.net> User-Agent: Mutt/1.4i Topicbox-Message-UUID: 216ce69e-eacb-11e9-9e20-41e7f4b1d025 On Fri, Nov 15, 2002 at 10:50:38AM +0000, Douglas A. Gwyn wrote: > presotto@plan9.bell-labs.com wrote: > > The idea that compiler optimization is a knob that you turn > > till some assumption you made becomes incorrect is scarey to me. > > A major purpose of the language standard is to define the > "treaty point": what a careful programmer has a right to expect > from the implementation and what latitude the implementation is > allowed. The problem with assumptions is that there is no > standard for them. While this is a fine sentiment, it is, in practice, not so easily applied by the programmer. In general, it is easier for run of the mill applications and much harder for operating systems. Can you name any major operating system written in C that actually compiles reliably with more than one compiler? How many even work with different major releases of the compiler? Some of this is probably due to sloppiness, but I don't think it is reasonable to claim that it is only due to sloppiness. The fact of the matter seems to be that in the real world the standard, although important, isn't as useful as you're claiming.