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 ..."
- From: dewar at gnat dot com (Robert Dewar)
- To: dewar at adacore dot com, gdr at integrable-solutions dot net
- Cc: autoconf-patches at gnu dot org, bug-gnulib at gnu dot org, eggert at CS dot UCLA dot EDU, gcc at gcc dot gnu dot org, kenner at vlsi1 dot ultra dot nyu dot edu
- Date: Sat, 30 Dec 2006 20:02:07 -0500 (EST)
- Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Gaby said
K&R C leaves arithmetic overflow undefined (except for unsigned
types), in the sense that you get whatever the underlying hardware
gives you. If it traps, you get trapped. If it wraps, you get wrapped.
Is that really what the K&R book says, or just what compilers typically
did? My memory is that the K&R book leaves it undefined period, but it's
a long time since I read it!