diff --git a/ports/unix/Makefile b/ports/unix/Makefile index d966e71327..ec60d8d2ad 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -213,7 +213,7 @@ ifeq ($(HASCPP17), 1) else CXXFLAGS += -std=c++11 endif -CXXFLAGS += $(filter-out -Wmissing-prototypes -Wold-style-definition -std=gnu99,$(CFLAGS) $(CXXFLAGS_MOD)) +CXXFLAGS += $(filter-out -Wmissing-prototypes -Wold-style-definition -std=gnu99 -std=gnu11,$(CFLAGS) $(CXXFLAGS_MOD)) ifeq ($(MICROPY_FORCE_32BIT),1) RUN_TESTS_MPY_CROSS_FLAGS = --mpy-cross-flags='-mcache-lookup-bc -march=x86' diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index e9674a3ec2..e5d0f7e2d3 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -22,7 +22,6 @@ FROZEN_DIR=variants/coverage/frzstr FROZEN_MPY_DIR=variants/coverage/frzmpy SRC_QRIO := $(patsubst ../../%,%,$(wildcard ../../shared-bindings/qrio/*.c ../../shared-module/qrio/*.c ../../lib/quirc/lib/*.c)) -$(info SRC_QRIO = $(SRC_QRIO)) SRC_C += $(SRC_QRIO) CFLAGS += -DCIRCUITPY_QRIO=1 diff --git a/py/mkrules.mk b/py/mkrules.mk index 81dd961ac6..50f35ffb22 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -65,7 +65,7 @@ vpath %.cpp . $(TOP) $(USER_C_MODULES) $(BUILD)/%.o: %.cpp $(call compile_cxx) -QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR +QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR -x c # frozen.c and frozen_mpy.c are created in $(BUILD), so use our rule # for those as well. diff --git a/py/mpprint.c b/py/mpprint.c index af485a50f2..df73587449 100644 --- a/py/mpprint.c +++ b/py/mpprint.c @@ -545,7 +545,12 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) { case 'p': case 'P': // don't bother to handle upcase for 'P' // Use unsigned long int to work on both ILP32 and LP64 systems - chrs += mp_print_int(print, va_arg(args, unsigned long int), 0, 16, 'a', flags, fill, width); + #if SUPPORT_INT_BASE_PREFIX + chrs += mp_print_int(print, va_arg(args, unsigned long int), 0, 16, 'a', flags | PF_FLAG_SHOW_PREFIX, fill, width); + #else + print->print_strn(print->data, "0x", 2); + chrs += mp_print_int(print, va_arg(args, unsigned long int), 0, 16, 'a', flags, fill, width) + 2; + #endif break; #if MICROPY_PY_BUILTINS_FLOAT case 'e': diff --git a/py/objfun.c b/py/objfun.c index 115957e09c..23698ad95c 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -182,7 +182,7 @@ qstr mp_obj_fun_get_name(mp_const_obj_t fun_in) { STATIC void fun_bc_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { (void)kind; mp_obj_fun_bc_t *o = MP_OBJ_TO_PTR(o_in); - mp_printf(print, "", mp_obj_fun_get_name(o_in), o); + mp_printf(print, "", mp_obj_fun_get_name(o_in), o); } #endif diff --git a/py/profile.c b/py/profile.c index e5fb35f0ed..2e59b97703 100644 --- a/py/profile.c +++ b/py/profile.c @@ -68,7 +68,7 @@ STATIC void code_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t k const mp_raw_code_t *rc = o->rc; const mp_bytecode_prelude_t *prelude = &rc->prelude; mp_printf(print, - "", + "", prelude->qstr_block_name, o, prelude->qstr_source_file, @@ -202,7 +202,7 @@ STATIC void frame_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t const mp_raw_code_t *rc = code->rc; const mp_bytecode_prelude_t *prelude = &rc->prelude; mp_printf(print, - "", + "", frame, prelude->qstr_source_file, frame->lineno, @@ -950,7 +950,7 @@ void mp_prof_print_instr(const byte *ip, mp_code_state_t *code_state) { /* long path */ if (1) { mp_printf(&mp_plat_print, - "@0x%p:%q:%q+0x%04x:%d", + "@%p:%q:%q+0x%04x:%d", ip, prelude->qstr_source_file, prelude->qstr_block_name, diff --git a/tests/extmod/uctypes_print.py.exp b/tests/extmod/uctypes_print.py.exp index 63daefc848..b1c730d44f 100644 --- a/tests/extmod/uctypes_print.py.exp +++ b/tests/extmod/uctypes_print.py.exp @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/tests/micropython/meminfo.py.exp b/tests/micropython/meminfo.py.exp index a229a7fa4c..fb9eaa890a 100644 --- a/tests/micropython/meminfo.py.exp +++ b/tests/micropython/meminfo.py.exp @@ -6,7 +6,7 @@ mem: total=\\d\+, current=\\d\+, peak=\\d\+ stack: \\d\+ out of \\d\+ GC: total: \\d\+, used: \\d\+, free: \\d\+ No. of 1-blocks: \\d\+, 2-blocks: \\d\+, max blk sz: \\d\+, max free sz: \\d\+ -GC memory layout; from \[0-9a-f\]\+: +GC memory layout; from 0x\[0-9a-f\]\+: ######## qstr pool: n_pool=1, n_qstr=\\d, n_str_data_bytes=\\d\+, n_total_bytes=\\d\+ qstr pool: n_pool=1, n_qstr=\\d, n_str_data_bytes=\\d\+, n_total_bytes=\\d\+ diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 57f4b139f9..2cf48de142 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -15,8 +15,8 @@ false true abc % # GC -0 -0 +0x0 +0x0 # vstr tests sts