This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C undefined behavior fix
- From: Momchil Velikov <velco at fadata dot bg>
- To: paulus at samba dot org
- Cc: Bernard Dautrevaux <Dautrevaux at microprocess dot com>, 'Tom Rini' <trini at kernel dot crashing dot org>, linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org, linuxppc-dev at lists dot linuxppc dot org
- Date: 03 Jan 2002 01:27:42 +0200
- Subject: Re: [PATCH] C undefined behavior fix
- References: <17B78BDF120BD411B70100500422FC6309E3ED@IIS000><15411.37236.181936.39729@argo.ozlabs.ibm.com>
>>>>> "Paul" == Paul Mackerras <paulus@samba.org> writes:
Paul> As I said in another email, if the gcc maintainers want to change gcc
Paul> so that pointer arithmetic can do anything other than an ordinary 2's
Paul> complement addition operation,
Nobody changes pointer arithmetic. The problem is that this
optimization gives _negative_ length, because the resulting pointer
does not point inside or one past the end of the array, which in turn
is explicitly mentioned in the standard as undefined behavior.
Paul> ... then we will stop using gcc.
Specifically separated this part to state that I don't even care to
comment on this. Doh, I did. Anyway ..
Regards,
-velco