8000 machine_int_t and int dichotomy · Issue #50 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
machine_int_t and int dichotomy #50
Closed
@pfalcon

Description

@pfalcon

I don't do 64bits. 32 bits should be enough if not for everyone, then at least for peaceful users, right? So, I never paid that much attention to the fact that Linux using LP64 memory model, where int is still 32 bits. So, uPy wants sizeof(integer type) == sizeof(void*) and defines machine_int_t. That's what stored in uPy objects then. But uPy still uses int everywhere, which is ~ incorrect, as may lead to overflow (unless it's done in covert careful manner which I missed from random grep). Ok, so solution would seem simple: just use machine_int_t everywhere. But! libc functions still take/return ints, so don't allow to use full range of uPy values.

What are guidelines on dealing with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    rfcRequest for Comment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0