Skip to content

Conversation

@magv
Copy link
Contributor

@magv magv commented Jun 19, 2025

Use stdint.h instead of INT{16,32,64}. Make WORD always int32_t, and drop ILP32 support. As discussed in #670. ILP32 deprecation was previously suggested in #624.

@magv
Copy link
Contributor Author

magv commented Jun 20, 2025

I guess because of all the LONG <-> pointer conversions in the code, LONG should really be the same as intptr_t (unless the conversions are fixed), which makes compilation on 32-bit systems broken if WORD/LONG are 32/64 bits.

@magv magv force-pushed the stdint branch 2 times, most recently from 8fababe to 3ff6564 Compare June 20, 2025 12:25
@coveralls
Copy link

coveralls commented Jun 20, 2025

Coverage Status

coverage: 50.594% (-0.009%) from 50.603%
when pulling 50d4bdc on magv:stdint
into 21f29a8 on form-dev:master.

magv added 2 commits June 20, 2025 15:58
This helps to reduce diagnostics reported by -Wconversion.
Also, drop declarations of some non-existing functions, and
change a few (but not all) of the functions that always succeed
to void.
@magv magv changed the title Use more stdint.h types, and drop ILP32 support Use more stdint.h types Jun 23, 2025
@magv
Copy link
Contributor Author

magv commented Jun 23, 2025

OK, so this is the current proposed set of changes to use stdint.h more. This is what was discussed in @670, except I've decided not to remove ILP32 support for not, because it turned out to be very helpful in catching WORD vs int distinction in the code (something I'd wish the compiler would do for us, but it wouldn't). Instead I've slightly simplified the detection of 32-bit platforms using stdint.h alone, and updated all the code that did #ifdef ILP32 to #if BITSINWORD == 16. I would, of course, still support deprecating the 32-bit support, but keeping the (minimal set of) tests for it running would still be beneficial.

@magv magv marked this pull request as ready for review June 23, 2025 09:57
@jodavies
Copy link
Collaborator

This cleanup looks good to me. Any comments from anyone else?

@tueda
Copy link
Collaborator

tueda commented Jun 24, 2025

If I'm not mistaken, off_t is 32 bits in 64-bit MSVC, but it may be OK to remove the large file support warning (anyway there would be more issues for LLP64 and no one cares).

@jodavies jodavies merged commit f63dcf4 into form-dev:master Aug 7, 2025
84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants