public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jim Meyering <jim@meyering.net>
To: Dr Andrew John Hughes <ahughes@redhat.com>
Cc: "Joseph S. Myers" <joseph@codesourcery.com>,
	 gcc-patches@gcc.gnu.org,  java-patches@gcc.gnu.org
Subject: Re: avoid useless if-before-free tests
Date: Tue, 08 Mar 2011 17:17:00 -0000	[thread overview]
Message-ID: <87oc5lpm58.fsf@rho.meyering.net> (raw)
In-Reply-To: <20110308165646.GF2877@rivendell.middle-earth.co.uk> (Andrew John	Hughes's message of "Tue, 8 Mar 2011 16:56:46 +0000")

Dr Andrew John Hughes wrote:
> On 22:47 Mon 07 Mar     , Joseph S. Myers wrote:
>> On Mon, 7 Mar 2011, Dr Andrew John Hughes wrote:
>>
>> > > 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?
>>
>> The original patch went only to gcc-patches.
>>
>> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00252.html
>>
>
> Thanks for the link.
>
> I'd like some explanation of why these changes are necessary before we start
> adding them to Classpath.  Are we just assuming that all free implementations
> will ignore NULL now?

IMHO, they're not officially "necessary", but rather nice to have,
since they eliminate code that is now obviously obsolete.
Those tests have been unnecessary for at least 5 years.
The efficiency (of removing the redundant test) is never the
issue for me, personally.  My main argument for making the change
is improved maintainability/readability:

  - less logic (esp. when the expression is more complicated)
  - no surprise (for reviewers who stopped using such tests years ago)
  - more compact, so more lines fit on a page/screen
  - removing unused code is always worthwhile

Sort of along the same lines as removing anachronistic casts of
malloc/calloc/realloc return values in C code.  No longer needed,
but many people continue to use them for no good reason.

  parent reply	other threads:[~2011-03-08 17:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87zkp9zmq0.fsf@rho.meyering.net>
2011-03-05 19:16 ` Joseph S. Myers
2011-03-07 19:52   ` Dr Andrew John Hughes
2011-03-07 22:47     ` Joseph S. Myers
2011-03-08 16:57       ` Dr Andrew John Hughes
2011-03-08 17:07         ` Andrew Haley
2011-03-08 17:17         ` Jim Meyering [this message]
2011-03-08 10:45   ` Jim Meyering
2011-03-08 14:21   ` [PATCH v2] " Jim Meyering
2011-03-08 14:30     ` Rainer Orth
2011-03-08 15:28       ` Ian Lance Taylor
2011-03-08 15:36         ` Jakub Jelinek
2011-03-08 17:03       ` Jim Meyering
2011-03-08 18:45         ` Rainer Orth
2011-03-08 19:13           ` Jim Meyering
2011-03-08 19:20             ` Rainer Orth
2011-03-08 19:39               ` Jakub Jelinek
2011-03-08 17:54     ` [PATCH v3] " Jim Meyering
2011-03-08 19:34       ` DJ Delorie
2011-03-15  9:19       ` Janne Blomqvist
2011-03-15 10:03         ` [PATCH gcc/fortran] get rid of gfc_free Jim Meyering
2011-03-15 10:08           ` Jakub Jelinek
2011-03-15 10:27             ` Jim Meyering
2011-03-15 14:18           ` Janne Blomqvist
2011-03-15 18:21             ` Jim Meyering
2011-03-24 16:51         ` [PATCH v3] Re: avoid useless if-before-free tests Jim Meyering
2011-04-15  7:26           ` Janne Blomqvist
2011-04-15  7:54             ` Jim Meyering
2011-04-15  8:20               ` Janne Blomqvist
2011-04-15  8:23                 ` Jim Meyering
2011-04-15 13:20                 ` Tom Tromey
2011-04-15 17:52                   ` Jim Meyering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oc5lpm58.fsf@rho.meyering.net \
    --to=jim@meyering.net \
    --cc=ahughes@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=java-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).