From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: Optimizations Date: Sun, 27 Sep 1998 20:06:22 -0300 Organization: BrunNet Lines: 24 Message-ID: <360EC4EE.52F3BE6E@unb.ca> References: <3606914B DOT 62A6 AT erols DOT com> NNTP-Posting-Host: usr3fton42.brunnet.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk John S. Fine wrote: > > One thing that sometimes helps in C is to explicitly tell the compiler > > that the functions called inside the loop have no side effects, by > > declaring it with __attribute__((const)). This is described in GCC docs, > > and sometimes has a dramatic effect on code generated for loops that call > > functions. > All of my routines in the entire project have side effects. I hope you don't take this the wrong way (and you undoubtably will), but I would call that bad programming structure. Side effects are bad things. There are some times when they are hard (or impossible) to avoid, but attempts should be made. That's one of the big ideas behind Object oriented programming. It divides data which needs to be accessed by many programs into logical chunks that can only be accessed by the required functions. -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT GeoCities DOT com Endlisnis AT BrunNet DOT Net