[LCP]Rounding questions

Chuck Martin nrocinu at myrealbox.com
Mon Sep 9 19:06:44 UTC 2002


On Sat, Sep 07, 2002 at 06:10:37PM +1000, Greg Black wrote:
> The next step would be to try turning them off selectively.  If
> there are a dozen .o files, it may be only one that has a bug
> introduced by the optimiser.  Try each one separately with the
> optimiser and see how it goes.

Unless the problem is in an unrelated part of the code, there is
only one file where I've had any problems, as far as I can tell.
However, the flag for optimizing is in a variable called CFLAGS in
the Makefile.  This would have to be moved to the rules for each
of the source files, instead.  Are C compilers command line options
standardized enough that this would be portable (There are different
sections in the Makefile for different O/S's and compilers that can
be commented/uncommented, and each might have its own CFLAGS).

> Certainly, unless it's absolutely huge, don't even think about
> the size of the executable -- modern disk is almost free and
> it's not worth accepting bugs to save a few bytes of disk.

I've always liked Forth and Assembler, and I probably obsess too
much on keeping things small, but I'll try not to let it bother
me.  :)

> In general, turning off buggy optimisation is a far better
> approach than "working around" bugs with unnecessary calls in
> the code.  It's a rational response to a real bug, while the
> other approach smacks of mysticism.

Thanks.  I'll keep that in mind.

Chuck





More information about the linuxCprogramming mailing list