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: avoid useless if-before-free tests


On 19:16 Sat 05 Mar     , Joseph S. Myers wrote:
> On Sat, 5 Mar 2011, Jim Meyering wrote:
> 
> > diff --git a/gcc/config/i386/gmm_malloc.h b/gcc/config/i386/gmm_malloc.h
> > index 7a7e840..8993fc7 100644
> > --- a/gcc/config/i386/gmm_malloc.h
> > +++ b/gcc/config/i386/gmm_malloc.h
> > @@ -67,8 +67,7 @@ _mm_malloc (size_t size, size_t align)
> >  static __inline__ void
> >  _mm_free (void * aligned_ptr)
> >  {
> > -  if (aligned_ptr)
> > -    free (((void **) aligned_ptr) [-1]);
> > +  free (((void **) aligned_ptr) [-1]);
> >  }
> 
> This one looks suspicious; it's not if (p) free (p); but if (p) free 
> (something-derived-from-p);.
> 
> > diff --git a/libjava/classpath/native/fdlibm/dtoa.c b/libjava/classpath/native/fdlibm/dtoa.c
> > index 458e629..92aa793 100644
> 
> http://gcc.gnu.org/codingconventions.html says Classpath changes should go 
> via Classpath upstream, not directly into GCC.  I don't know if that's 
> still accurate.
> 

That's still true.  This seems to be the first message I've received in this
thread, so I'm not even aware of what these changes are.  Were the earlier
messages not sent to this list?

> > diff --git a/zlib/contrib/minizip/unzip.c b/zlib/contrib/minizip/unzip.c
> > index 9ad4766..644ef1b 100644
> 
> We definitely don't want to make local changes to zlib for this sort of 
> issue, though importing a new upstream version of zlib (making sure the 
> local configure code still works) should be fine for 4.7.
> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D  0698 0713 C3ED F586 2A37


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