I have the following in my library #define FIXED_LEN_STR 255 typedef char fixed_len_str_t[FIXED_LEN_STR];
In my cdef(""" #define FIXED_LEN_STR ... // This works typedef char fixed_len_str_t[...]; // this does not work """)
Is my only choice to explicitly do the following? Is there a better way of doing this? typedef char fixed_len_str_t[255];
Also, the Error message when it hits the problem is as follows, which doesn't tell me where the error is. For now I understand this generally means and where to look. But for people with no experience with CFFI, it would be help full to provide some context or line numbers or something to help locate the point the cdef where this error happens.
File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/api.py", line 84, in cdef self._parser.parse(csource, override=override) File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/cparser.py", line 100, in parse self._internal_parse(csource) File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/cparser.py", line 137, in _internal_parse realtype = self._get_type(decl.type, name=decl.name) File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/cparser.py", line 222, in _get_type typenode.dim, partial_length_ok=partial_length_ok) File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2. 6-linux-x86_64.egg/cffi/cparser.py", line 446, in _parse_constant raise api.FFIError("unsupported non-constant or " cffi.api.FFIError: unsupported non-constant or not immediately constant expression
I have always got quick responses so far, but haven't seen any for my recent questions.
Are these dumb questions, possibly? Or maybe too many questions :-))
I have always tried multiple routes at debugging and googling for answers before asking these questions. And from what I can tell, all the questions I have asked so far, bar 1 which ended being a bug in my library, ended in either a bug fix or document update.
I hope this is just a case of people being too busy. :-))
On Thu, Oct 4, 2012 at 10:15 AM, Sarvi Shanmugham <sarvil...@gmail.com> wrote:
> I hope this is just a case of people being too busy. :-))
Yes, exactly :-) Your questions are very useful, I have to thank you
for them. They end up in good suggestions for improvements of CFFI.
I'll come back to your recent questions, but right now I'm at PyCon ZA
(South Africa) :-)
On Thursday, October 4, 2012 4:37:14 AM UTC-7, Armin Rigo wrote:
> Hi,
> On Thu, Oct 4, 2012 at 10:15 AM, Sarvi Shanmugham <sarv...@gmail.com<javascript:>> > wrote: > > I hope this is just a case of people being too busy. :-))
> Yes, exactly :-) Your questions are very useful, I have to thank you > for them. They end up in good suggestions for improvements of CFFI. > I'll come back to your recent questions, but right now I'm at PyCon ZA > (South Africa) :-)
On Sunday, October 28, 2012 1:44:48 AM UTC-7, Armin Rigo wrote:
> Hi,
> On Thu, Oct 4, 2012 at 9:38 PM, Sarvi Shanmugham <sarv...@gmail.com<javascript:>> > wrote: > > I noticed that > > char my_array_variable[...]; // Does not work
> > But the following works > > char my_array_variable[]; // This works
> I fixed this use case to make the two declarations identical > (3bb5d49c0c00).