hi guys,

I defined a structure like this:

struct s {
    uint16_t a;
    uint16_t b;
    uint16_t c;
};

and I want to add a global variable which is an array of this structure
like this:

struct s array[28];

using CIL automatically.

The CIL code I use is:

  let myType = Formatcil.cType
               "struct s [%d:bbs]"
               [("bbs",Fd !num_bbs) ] in
  let cntArr = makeGlobalVar "array" myType in

but there is always an error:

Warning: Parsing raised Invalid_argument("index out of bounds")

<string>[1:0-0] : syntax error
Error: Parsing error: struct s [%d:bbs]
Fatal error: exception Errormsg.Error

Is there anyone who knows how to solve this problem?
Lipeng
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to