[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."

From: Robert Dewar
Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Date: Sat, 30 Dec 2006 19:28:06 -0500
User-agent: Thunderbird (Windows/20061207)

Paul Eggert wrote:

For writing new code, it's easy: the C standard is all
that should be assumed.  Old code should be modified, as
time allows, to be consistent with that standard.

This may be the policy of the GCC developers for the code
they maintain, but it's not a realistic policy for
everybody, and GCC shouldn't insist on it, or even recommend
it, for everybody.  I certainly can't assume it for the code
I help maintain, as the minimal GCC standard is far too

Now that's extreme, it's one thing to say that existing
code may have bad assumptions, it is quite another to
disagree with a policy that all code should be in C,
and that when we find code that strays into undefined
territory it should be fixed. If nothing else it is
important for maintenance that everyone know what
language they are writing in.

Of course there is a way out that satisfies both
sides here, and that is to declare that gcc code
should adhere to the standard *including* LIA
and then make sure the default mode of gcc is
LIA compliant.

Then we

a) have a well defined language
b) have a language that is standardized
c) stay clear of undefinedness

For gcc tools themselves, I suspect the possible
loss in performance is unmeasurable, and it
resolves entirely (at least for the wrapping
issue) the tension between lets-write-standard-stuff
and lets-write-traditional-stuff.

By the way, does traditional C really assume this? Is
it the case that the original K&R document guarantees
wrapping, or is what you meant here "traditional C
compilers". There is quite a difference!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]