micropython variable argument macro define compilation errors with keilv5.18

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
chitturi123
Posts: 7
Joined: Mon Jan 16, 2017 6:11 am

micropython variable argument macro define compilation errors with keilv5.18

Post by chitturi123 » Wed Jun 21, 2017 5:05 am

I was using micropython library for my project with CoIDE with gcc tool chain.
There is no problem of compilation.
Later i shifted to Keil IDE with armcc tool chain.
But i have compilation errors in variable argument macro defines code.

In micropython/py/grammar.h file the following macro defines are present
Only 2 defines are given. There are lot more in the header file

DEF_RULE(single_input, nc, or(3), tok(NEWLINE), rule(simple_stmt), rule(compound_stmt))
DEF_RULE(file_input, c(generic_all_nodes), and_ident(1), opt_rule(file_input_2))

In micropython/py/parse.c file the following is the definition

STATIC const rule_t *const rules[] = {
#define DEF_RULE(rule, comp, kind, ...) &rule_##rule,

#include "py/grammar.h"
#undef DEF_RULE
};

In micropython/py/comple.c file the following is the definition

typedef enum {
#define DEF_RULE(rule, comp, kind, ...) PN_##rule,
#include "py/grammar.h"
#undef DEF_RULE
PN_maximum_number_of,
PN_string, // special node for non-interned string
PN_bytes, // special node for non-interned bytes
PN_const_object, // special node for a constant, generic Python object
} pn_kind_t;

Keil throws the following type of errors

..\..\..\Micropython\py\grammar.h(81): error: #1077: an initializer cannot be specified for a flexible array member

EF_RULE(single_input, nc, or(3), tok(NEWLINE), rule(simple_stmt), rule(compound_stmt)) //6 arguments
..\..\..\Micropython\py\grammar.h(82): error: #1077: an initializer cannot be specified for a flexible array member

EF_RULE(file_input, c(generic_all_nodes), and_ident(1), opt_rule(file_input_2)) //4 arguments
..\..\..\Micropython\py\grammar.h(83): error: #1077: an initializer cannot be specified for a flexible array member

Pl help me to fix these type of errors.

mvddf
Posts: 1
Joined: Thu Jan 31, 2019 8:20 pm

Re: micropython variable argument macro define compilation errors with keilv5.18

Post by mvddf » Thu Jan 31, 2019 8:27 pm

I have encountered the same issue.
Have you even been able to resolve it?

Thanks

Post Reply