This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: don't assume pointer cast to unsigned long is a validinitializer
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: Alexandre Oliva <aoliva at redhat dot com>, rth at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: 28 Feb 2003 17:36:22 -0800
- Subject: Re: don't assume pointer cast to unsigned long is a validinitializer
- References: <orznogn7qt.fsf@free.redhat.lsd.ic.unicamp.br> <jmk7fkvyu5.fsf@desire.geoffk.org>
On Fri, 2003-02-28 at 14:12, Geoff Keating wrote:
> Alexandre Oliva <aoliva at redhat dot com> writes:
>
> > +++ gcc/testsuite/gcc.c-torture/compile/20010327-1.c 28 Feb 2003 08:12:12 -0000
> > @@ -1,2 +1,6 @@
> > extern void _text;
> > -static unsigned long x = (unsigned long) &_text - 0x10000000L - 1;
> > +/* We use __SIZE_TYPE__ here because it's as wide as a pointer, so we
> > + know we won't have a non-constant because of extension or
> > + truncation of the pointer to fit. */
> > +static __SIZE_TYPE__ x
> > + = (__SIZE_TYPE__) &_text - (__SIZE_TYPE__) 0x10000000L - 1;
>
> Not OK. See the CVS log and mailing list archives for why.
> Please back out your change.
Would you be so kind as to add a comment in the code containing whatever
is in the mailing list archives and CVS logs? I would have tended to
approve that patch as well, just looking at it.
Thanks,
--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery dot com