autopxd2 generates invalid code when array subscript is a calculated define
I have the following C code:
#define NUMBER_A 64
#define NUMBER_B 4
#define SUMMATION (NUMBER_A + NUMBER_B)
int some_function(uint8_t valuesOut[2][SUMMATION], uint8_t valuesIn[NUMBER_B]);
This code compiles fine, but autopxd2 generated invalid Cython. What gets generated in my .pxd file is:
int some_function(uint8_t valuesOut[2][], uint8_t valuesIn[4]);
...which fails to compile with the following error:
Array element type 'uint8_t []' is incomplete
I turned on preproccessor debugging and it generates an appropriate signature of the following:
int some_function(uint8_t valuesOut[2][(64 + 4)], uint8_t valuesIn[4]);
But somewhere along the way - the generated Cython is incorrect.
Any ideas?
I wonder if you used the preprocessing built into pycparser (as per this example), if things would fare better?
@markmelvin sorry, just seeing this now. This project isn't under active development but I'd be happy to review and release any pull requests submitted.