[cfe-dev] how to determine a parameter has a type declarator inclang

kevinlynx kevinlynx at gmail.com
Thu Jan 3 17:36:24 PST 2013


Thanks, it worked on 1 parameter function, but does not work on more than one parameters function, say,

    void func(int a, b)

`hasWrittenPrototype` still return true, and `b` will also get a default `int` type. 



------------------ Original ------------------
From:  "John McCall"<rjmccall at apple.com>;
Date:  Fri, Jan 4, 2013 04:51 AM
To:  "kevin"<kevinlynx at gmail.com>; 
Cc:  "cfe-dev"<cfe-dev at cs.uiuc.edu>; 
Subject:  Re: [cfe-dev] how to determine a parameter has a type declarator inclang



On Dec 30, 2012, at 11:44 PM, kevin <kevinlynx at gmail.com> wrote:
> I use clang to do some code analyse. And now i have a function below
> 
>     void func(p)
> 
> some compilers will process p as an integer. And i want to know how to determine whether p has a type declarator ?

You can ask whether the function has a written prototype.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130104/c63e1785/attachment.html>


More information about the cfe-dev mailing list