[cfe-dev] get sizeof(*) 's value

huc1985 huc1985 at 163.com
Mon Mar 25 01:50:53 PDT 2013


Hi,
    I'm using a RecursiveASTVisitor and its VisitCallExpr method. I want to
find out all location using malloc. How to get the sizeof(*)'s value?
 
    for example:

     code:    
          char* a = (char*)malloc(sizeof(char));   
          int* b = (int*)malloc(sizeof(int));   
     result:
          a, fun:malloc, alloc size:1bytes
          b, fun:malloc, alloc size:4bytes

     I want to know somthing like this. 

    Thanks 



--
View this message in context: http://clang-developers.42468.n3.nabble.com/get-sizeof-s-value-tp4031125.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list