ccbuluo / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Add support for compilers that don't allow zero-sized arrays #238

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported by GilRoss on maillist on 2012/06/21:

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.

Original issue reported on code.google.com by dwhall...@gmail.com on 22 Jun 2012 at 3:12

GoogleCodeExporter commented 9 years ago
Modified the code generation in src/tools/pmCoCreator.py to create a special 
case for zero-length tuples: declare a type that doesn't have an object array 
and declare an instance that is length zero with no object array.

Original comment by dwhall...@gmail.com on 22 Jun 2012 at 3:33

GoogleCodeExporter commented 9 years ago
Fixed by r6c75b1f7476e  

Original comment by dwhall...@gmail.com on 22 Jun 2012 at 3:36