mlibc icon indicating copy to clipboard operation
mlibc copied to clipboard

Review architecture specific defines

Open 64 opened this issue 1 year ago • 4 comments

Some architecture specific defines are really just checking for 32-bit / 64-bit: we should refactor these to directly check for pointer size so new ISA ports require less boilerplate.

e.g https://github.com/managarm/mlibc/blob/3b0bc20fd2e2d41545f1ddbe21f7652c56af8cd0/tests/ansi/strtol.c#L66-L76

64 avatar Oct 13 '24 22:10 64

hey @64 can I take this one?

VeerChaurasia avatar Oct 17 '24 04:10 VeerChaurasia

Sure :)

64 avatar Oct 17 '24 09:10 64

Is this still an issue? if it is, can I work on it?

Watrdguy avatar Oct 01 '25 18:10 Watrdguy

We have done some work on this, but I think there are still a few suboptimal cases around. With the recently merged ABI checker (see #1456, or the current report on master) we caught a few unfortunate and hard-to-detect mistakes, so I'd expect the number of instances to have gone down compared to before.

FWIW it would make sense to review all such cases and make sure they do what we'd expect them to do, i.e. to avoid issues of using macros from limit.h when it's not included, instead preferring to use __INTPTR_WIDTH__ and similar compiler-defined macros.

no92 avatar Oct 01 '25 19:10 no92