Problem with PM_DECLARE_TUPLE_TYPE(0) and #line directive.

27 views
Skip to first unread message

GilRoss

unread,
Jun 21, 2012, 8:09:09 PM6/21/12
to python-o...@googlegroups.com
1. The macro:
 
*****
/** Tuple object declaration macro (used by output of pmCoCreator.py) */
#define PM_DECLARE_TUPLE_TYPE(n) \
    typedef struct PmTuple ## n ## _s \
    { \
        PmObjDesc_t od; \
        int16_t length; \
        pPmObj_t val[n]; \
    } PmTuple ## n ## _t
*****
causes problems when n = 0. For example: PM_DECLARE_TUPLE_TYPE(0);. The IAR compiler does not like pPmObj_t val[n]; when n = 0.
 
 
2. The IAR compiler is generating warnings for the following auto-generated line of C code:
 
#line 24 "C:\Projects\TouchKit\CBComm\Mpc04Firmware\..\shared\python2\src\lib\list.py"
 
The warning is: "Warning[Pe192]: unrecognized character escape sequence C:\Projects\TouchKit\CBComm\Mpc04Firmware\pm_generated_objs.c 47".
 
Thanks,
Gil

Dean Hall

unread,
Jun 21, 2012, 10:38:50 PM6/21/12
to python-o...@googlegroups.com
A workaround for #1 would be to have all your code auto-generated, then manually edit the Tuple0 instance. There will only be one of them.

For #2, I believe IAR has the ability to selectively turn off warnings. I know that's not a great solution, but if you don't have a code-based workaround, then it's the way to go. IAR may also have a different syntax for the #line directive. I don't have an IAR manual anymore so you'll have to hunt.

!!Dean
> --
> You are subscribed to the "python-on-a-chip" (or p14p for short) Google Group.
> Site: http://groups.google.com/group/python-on-a-chip

Dean Hall

unread,
Jun 21, 2012, 11:12:38 PM6/21/12
to python-o...@googlegroups.com
Okay, I see how I can fix this. It'll just be a special case in the code generator. I'm working on it: http://code.google.com/p/python-on-a-chip/issues/detail?id=238

!!Dean


On Jun 21, 2012, at 6:09 PM, GilRoss wrote:

Dean Hall

unread,
Jun 22, 2012, 11:37:50 AM6/22/12
to python-o...@googlegroups.com
Okay, I solved #1. But #2 is something you're going to have to figure out.

http://code.google.com/p/python-on-a-chip/issues/detail?id=238

!!Dean


On Jun 21, 2012, at 6:09 PM, GilRoss wrote:

Reply all
Reply to author
Forward
0 new messages