[cfe-dev] clang-modernize feature (was: Rename cpp11-migrate to be something more general?)

Richard legalize at xmission.com
Wed Sep 4 12:33:44 PDT 2013


In article <CAJdarcHpLLjcXUgQzOpOQB0cuzTJQtehT+aggH_niAJFtRekQw at mail.gmail.com>,
    Eli Friedman <eli.friedman at gmail.com> writes:

> On Tue, Sep 3, 2013 at 2:52 PM, Richard <legalize at xmission.com> wrote:
> > My questions for this audience are:
> >
> > 1) is this considered a "modernizing" transform that is appropriate
> >    for clang-modernize?
> >
> 
> Maybe?  Some people might consider it more of a style choice.

It is my understanding that the syntax "(void)" is for compatibility
with C, where (void) is needed to explicitly say that a function takes
no arguments and () is the legacy syntax used by older C code before
function prototypes.

Am I wrong?

> > 2) how do I walk arbitrary type declarations like this without having
> >    to re-invent parsing the type expressions?
> >
> > You walk type declarations using TypeSourceInfo: FunctionTypeLoc has
> functions to retrieve the LParen and RParen locations for a function type
> declaration.

The problem is that source locations just give me a position within
the text, they don't give me smaller units of semantic structure that
I can walk.  Finding the start and end positions in the source text is
easy -- what I'm stumbling with is finding the corresponding parsed
structure from that text.
-- 
"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