Skip to content

Invalid return value in "machine_uart.c" #190

@WebDust21

Description

@WebDust21

I have been trying to compile microPython for qemu-vexpress-a9, and have run into a problem.

Compilation fails here:

CC build/packages/micropython-v1.13.0/port/modules/machine/machine_lcd.o
CC build/packages/micropython-v1.13.0/port/modules/machine/machine_pin.o
CC build/packages/micropython-v1.13.0/port/modules/machine/machine_pwm.o
CC build/packages/micropython-v1.13.0/port/modules/machine/machine_rtc.o
CC build/packages/micropython-v1.13.0/port/modules/machine/machine_timer.o
CC build/packages/micropython-v1.13.0/port/modules/machine/machine_uart.o
packages/micropython-v1.13.0/port/modules/machine/machine_uart.c: In function 'machine_uart_ioctl':
packages/micropython-v1.13.0/port/modules/machine/machine_uart.c:253:12: error: return makes integer from pointer without a cast [-Werror=int-conversion]
     return NULL;
            ^~~~
cc1: all warnings being treated as errors
scons: *** [build/packages/micropython-v1.13.0/port/modules/machine/machine_uart.o] Error 1
scons: building terminated because of errors.

The offending line of source code is here:

STATIC mp_uint_t machine_uart_ioctl(mp_obj_t obj, mp_uint_t request, uintptr_t arg, int *errcode) {
    return NULL;
}

In all other cases I can find in the RT-Thread microPython port, a function defined as "STATIC mp_uint_t" must have a numeric return value, for example

return -1;

Please advise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions