Path: utzoo!utgpu!water!watmath!clyde!ima!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.c Subject: Re: Pragmas Message-ID: <14548@think.UUCP> Date: 11 Jan 88 20:44:10 GMT References: <17196@topaz.rutgers.edu> <6920@brl-smoke.ARPA> <14460@think.UUCP> <3313@ihlpf.ATT.COM> Sender: usenet@think.UUCP Reply-To: barmar@sauron.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge, MA Lines: 28 In article <3313@ihlpf.ATT.COM> nevin1@ihlpf.UUCP (00704A-Liber,N.) writes: >I agree. However, suppose I compile a program that uses 'noalias' with a >compiler that ignores 'noalias'. I test it and find no problems. I now have a >program which I believe works but if ported to a compiler which uses 'noalias' >it might develop a bug. Suppose I compile a program that uses 36-bit numbers on a machine with 36-bit words. I test it and find no problems. I now have a program which I believe works but if ported to a machine with 32-bit words it might develop a bug. >I believe that all programs which will conform to the ANSI C standard should >run equivalently under all compilers that conform to ANSI C. (I do not believe >that ANSI requires a compiler writer to implement the optimizations that can be >made with the use of noalias.) With noalias, this cannot be assured. A program which declares a variable as 'noalias' and then makes use of multiple handles to the variable in such a way that it matters whether 'noalias' is recognized does not "conform to the ANSI C standard", so you shouldn't expect it to run equivalently. You can't expect an invalid program to exhibit the same bug in all implementations, because the standard only specifies the behavior of valid programs. Barry Margolin Thinking Machines Corp. barmar@think.com uunet!think!barmar