[cfe-dev] [clang-tidy] Some possible contributions

Richard via cfe-dev cfe-dev at lists.llvm.org
Wed Dec 16 10:13:30 PST 2015


[Please reply *only* to the list and do not include my email directly
in the To: or Cc: of your reply; otherwise I will not see your reply.
Thanks.]

In article <56709B81.2020403 at gmail.com>,
    Piotr Dziwinski via cfe-dev <cfe-dev at lists.llvm.org> writes:

> On 15/12/15 21:10, Richard via cfe-dev wrote:
> > I remember now that I was looking into this for a check that would
> > split a multiple variable declaration into multiple single variable
> > declarations. [...]
> 
> Well, taking the assumption that all variable declarations are single 
> declarations would simplify my localizing variables checker a great deal 
> and make issue #1 obsolete.

OK, good we're on the same thought track.

> On the other hand, I worry about the decreased usability from the user's 
> point of view.

Agreed.

> He would have to first run the checker that splits multiple 
> declarations, applying its fixes everywhere.
> Only then, as a second step, he would be able to run the localizing 
> variables checker, and use its fixes.

How would a user feel if the localizing check broke down multiple
delcarations into single declarations as a by-product?

In other words:

int i, j, k;
// many lines of code
i = 10;

becomes

int j;
int k;
// many lines of code
int i = 10;

Would this be unacceptable?
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>


More information about the cfe-dev mailing list