Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Michael Snyder <msnyder@vmware.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables
Date: Sun, 09 May 2010 09:14:00 -0000	[thread overview]
Message-ID: <20100509091353.GB7479@adacore.com> (raw)
In-Reply-To: <20100508211155.GA12079@host0.dyn.jankratochvil.net>

> >  static void
> >  do_fclose_cleanup (void *arg)
> >  {
> > -  FILE *file = arg;
> >    fclose (arg);
> >  }
> 
> I believe the intentional was rather `fclose (file);' according to the general
> GDB template of callback functions:

Good catch, Jan.

> void
> func (void *arg)
> {
>   real_type *var = arg;
>   
>   Use VAR having it type-checked callee prototypes or real_type changes.
> }
> 
> But I understand it is a nitpick for never-changing FILE * and fclose.

I think it's still important that we follow that paradigm (IMO).
It makes the code clearer.

-- 
Joel


  reply	other threads:[~2010-05-09  9:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07  0:50 Michael Snyder
2010-05-08 21:12 ` Jan Kratochvil
2010-05-09  9:14   ` Joel Brobecker [this message]
2010-05-10 17:26     ` Michael Snyder

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=20100509091353.GB7479@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=msnyder@vmware.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