On Mon, Mar 18, 2019 at 5:09 PM William A Rowe Jr <wr...@rowe-clan.net> wrote:
> > please test the attached, it works for me on Fedora, but need to verify at > least BSD, Solaris, etc. mingw remains special-case so it shouldn't be > affected. This should force off_t_fmt to "ldd" in the cases Stefan observed. > > Notably, it might not do the right thing with respect to strictness until > we cover a particular c compiler in APR_TRY_COMPILE_NO_WARNING(). The > mismatched int type assignments should crack under most any compiler, but > mismatched printf formatting might not. APR_CHECK_TYPES_FMT_COMPATIBLE() > uses that logic to perform a cross-platform compile torture test against > our [s]size_t/off_t types, in place of the very peculiar > APR_CHECK_TYPES_COMPATIBLE() which didn't appear to be portable beyond gcc > at all, and was much too tolerant of language warnings. > > I personally think it should be a little more robust about checking that > strtoll/_strtoll/_strtoq is available and appropriate and drop more of the > apr_int64_t assumptions around off_t handling, but that was going a little > too far off in the weeds. > Not so far off, the logic in the final patch will be; APR_CHECK_TYPES_FMT_COMPATIBLE(ssize_t, long, ld, [ssize_t_fmt="ld"], [ APR_CHECK_TYPES_FMT_COMPATIBLE(ssize_t, int, d, [ssize_t_fmt="d"]) ]) APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned long, lu, [size_t_fmt="lu"], [ APR_CHECK_TYPES_FMT_COMPATIBLE(size_t, unsigned int, u, [size_t_fmt="u"]) ]) in order to prefer long over int, where both are acceptable mappings, as the code in 1.6.x has done. The preferences in off_t logic should already be correct as proposed.