This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: don't assume pointer cast to unsigned long is a validinitializer


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]