mirage / ocaml-solo5

Freestanding OCaml runtime
Other
101 stars 30 forks source link

openbsd int64 formatter #63

Closed cfcs closed 4 years ago

cfcs commented 4 years ago

https://github.com/mirage/ocaml-freestanding/blob/master/config.in/m.x86_64.h#L13

I believe this should be included in the ifdef guard and be set to ll on openbsd? see https://man.openbsd.org/printf.3

ping @adamsteen

adamsteen commented 4 years ago

@cfcs

i am not sure, i haven't seen any problems using ocaml-freestanding, but if you have tested it and are happy with the results, make the change.

I am sorry i can not volunteer to test and make the fix, life circumstances have severely limited my access and time if from of a computer, but please feel free to test and make a change.

mato commented 4 years ago

I'm not sure what is required here. There was someone on IRC reporting that "it doesn't work with OpenBSD", but did not file an issue or provide details. I do recall that OpenBSD has a different idea of integer/pointer sizes to every other *NIX on amd64.

I'd suggest running the standard OCaml configure on OpenBSD and comparing the resulting generated files with those in ocaml-freestanding, then reconciling any differences / adding OpenBSD-specific templates if need be.

cfcs commented 4 years ago

I don't think this is the cause of that bug report, just noting that it is incorrect, and in theory could lead to truncation or compiler warnings/errors if that macro is used. In theory, because it would apply on platforms where long and long long are not equivalent, which doesn't seem to be the case for any platforms we care about. Where it could matter is if some compiler decides to get strict about types.

mato commented 4 years ago

As far as I can tell, this is fixed by #65 which will be in the next release, so closing this issue.