Mail Archives: djgpp/1998/09/27/20:00:17
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
- Raw text -