[libvirt] [PATCH v3 04/35] cfg.mk: single variable declaration per line when using cleanup macro

Pavel Hrdina phrdina at redhat.com
Wed Jul 11 08:35:25 UTC 2018


On Wed, Jul 11, 2018 at 12:42:43AM +0530, Sukrit Bhatnagar wrote:
> On Tue, 10 Jul 2018 at 16:24, Erik Skultety <eskultet at redhat.com> wrote:
> >
> > On Sat, Jun 30, 2018 at 02:30:08PM +0530, Sukrit Bhatnagar wrote:
> > > Add rule to ensure that each variable declaration made using
> > > a cleanup macro is in its own separate line.
> > >
> > > Sometimes a variable might be initialized from a value returned
> > > by a macro or a function, which may take on more than one
> > > parameter, thereby introducing a comma, which might be mistaken
> > > for multiple declarations in a line. This rule takes care of
> > > that too.
> >
> > I can't think of an example or I'm just not seeing it, can you please give me
> > an example where you actually need the rule below? Because right now I don't
> > see a need for it.
> 
> In src/util/virfile.c in virFileAbsPath function:
> ...
> VIR_AUTOFREE(char *) buf = getcwd(NULL, 0);
> ...

I don't see anything wrong with it, it is properly initialized to some
value, it doesn't have to be only NULL.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180711/f2da7a6e/attachment-0001.sig>


More information about the libvir-list mailing list