PCRE2Project / pcre2

PCRE2 development is now based here.
Other
917 stars 191 forks source link

Address most implicit 64-to-32-bit conversion warnings. #525

Open ucko opened 1 month ago

ucko commented 1 month ago

Visual Studio and Xcode both issue such warnings by default, and Clang also offers a -Wshorten-64-to-32 option to expose them elsewhere. To address them, harmonize types where practical and add casts as appropriate (first formally capping executables' read request sizes as necessary). NB: detect_repeat in pcre2_jit_compile.c still yields two such warnings that look plausibly legitimate but not so easy to fix. :-/

ucko commented 1 month ago

Thanks for the quick feedback! I've force-pushed a largely corrected (and rebased) version and will reply on individual points shortly. AFAICT, some of these changes really should help in corner cases; although the remainder are formalities, the (configuration-dependent) warnings they address could bury other warnings (none here at present, I'm happy to report).

I acknowledge that this PR still needs more work.