|
From: Stefan Z. <sz...@gm...> - 2011-08-03 14:26:23
|
On Thu, Jul 28, 2011 at 4:29 PM, Shi Hu <fin...@gm...> wrote: > > Hi, > > I am trying to build a bridge between Python and C. I am not sure why I > can't do this in my interface/header file: int array[(int) 3 > 2]. > > In another word, it seems that SWIG can't take boolean expression as the > size of an array. But this is legitimate in C. > > For details, when I do: swig -python example.i, SWIG gives example.i:9: > Error: Syntax error in input(1) as the error message. > I don't think this is a big surprise. For SWIG to process that correctly, its parser would have to be a great deal more complex -- it would have to evaluate the expression '(int) 3 > 2'. I think that's beyond the scope of this project. Stefan |