This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] Replace libdw nested functions with macros, part 1.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 17 Sep 2015 13:04:56 -0700
- Subject: Re: [PATCH] Replace libdw nested functions with macros, part 1.
> Does the new walk_children look right to you?
> That style is similar to what I would use when I need to factor out code in
> large C functions. It should be general enough to replace all nested
> functions in elfutils.
The general style of factoring out the shared locals into by-reference
parameters of the subfunction is right. How much to put into a bespoke
local struct and how much to do with multiple parameters is a case by case
decision about what feels most clean and concise in the source code.
I don't favor typedefs for private types like that. Just use 'struct foo'.
Some of the indentation choices and other style nits didn't look quite
right off hand, but those are trivia.