This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
"Seongbae Park" <seongbae.park@gmail.com> writes:
| On 30 Dec 2006 03:20:11 +0100, Gabriel Dos Reis
| <gdr@integrable-solutions.net> wrote:
| ...
| > The C standard, in effect, has an appendix (Annex H) that was not
| > there in the C89 edition, and that talks about the very specific issue
| > at hand
| >
| > H.2.2 Integer types
| >
| > [#1] The signed C integer types int, long int, long long
| > int, and the corresponding unsigned types are compatible
| > with LIA-1. If an implementation adds support for the LIA-1
| > exceptional values ``integer_overflow'' and ``undefined'',
| > then those types are LIA-1 conformant types. C's unsigned
| > integer types are ``modulo'' in the LIA-1 sense in that
| > overflows or out-of-bounds results silently wrap. An
| > implementation that defines signed integer types as also
| > being modulo need not detect integer overflow, in which
| > case, only integer divide-by-zero need be detected.
|
| which clearly says LIA-1 isn't a requirement - notice "if" in the
| second setence.
I never said it was a requirement, right?
| H.1 makes it clear that the entire Annex H doesn't add any extra rule
| to the language but merely describes what C is in regard to LIA-1.
| H.2 doubly makes it clear that C as it defined isn't LIA-1
| - again, notice "if" in H.2p1.
| The second sentence of H.3p1 confirms this again:
|
| C's operations are compatible with LIA−1 in that C
| allows an implementation to cause a notification to occur
| when any arithmetic operation
| returns an exceptional value as defined in LIA−1 clause 5.
|
| i.e. "compatible" means C's definition doesn't prevent
| a LIA-1 conformant implementation.
Right.
| In other words, all LIA-1 comformant compiler is conformant to C99
| in terms of arithmetic and types.
Right.
| However, not all C99 conformant compiler aren't LIA-1 conformant.
Right.
| C isn't conformant to LIA-1 but merely compatible,
| exactly because of the undefined aspect.
I don't think it is accurate to say that C isn't conformant yp LIA-1,
since its specification does make room for LIA-1 conformance,
indicating how that can be made. A point made at the very begining of
this thread.
-- Gaby