This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [patch] serial, mdebugread, top.c, utils, frame.c: remove unused variables


> >  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


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