On Mon, Mar 18, 2019 at 05:09:40PM -0500, William A Rowe Jr wrote: > Hi folks, > > 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. > > TIA for your reviews and feedback, > > Bill
I don't believe your diff attempts to address this, but I am stilling seeing a problem with APR_TIME_T_FMT when compiling httpd: proxy_util.c:3179: warning: format '%ld' expects type 'long int', but argument 9 has type 'long long int' Results for off_t look good. All platforms listed below use clang 6.0.0, except sparc64 which still uses ancient GPLv2 GCC 4.2.1 20070719. OpenBSD/amd64: $ grep ^ac_cv_sizeof config.log ac_cv_sizeof_char=1 ac_cv_sizeof_ino_t=8 ac_cv_sizeof_int=4 ac_cv_sizeof_long=8 ac_cv_sizeof_long_long=8 ac_cv_sizeof_off_t=8 ac_cv_sizeof_pid_t=4 ac_cv_sizeof_short=2 ac_cv_sizeof_size_t=8 ac_cv_sizeof_ssize_t=8 ac_cv_sizeof_struct_iovec=16 ac_cv_sizeof_voidp=8 before: $ grep T_FMT config.log int64_t_fmt='#define APR_INT64_T_FMT "ld"' off_t_fmt='#define APR_OFF_T_FMT "ld"' pid_t_fmt='#define APR_PID_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' after: $ grep T_FMT config.log int64_t_fmt='#define APR_INT64_T_FMT "ld"' off_t_fmt='#define APR_OFF_T_FMT "lld"' pid_t_fmt='#define APR_PID_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' OpenBSD/i386: $ grep ^ac_cv_sizeof config.log ac_cv_sizeof_char=1 ac_cv_sizeof_ino_t=8 ac_cv_sizeof_int=4 ac_cv_sizeof_long=4 ac_cv_sizeof_long_long=8 ac_cv_sizeof_off_t=8 ac_cv_sizeof_pid_t=4 ac_cv_sizeof_short=2 ac_cv_sizeof_size_t=4 ac_cv_sizeof_ssize_t=4 ac_cv_sizeof_struct_iovec=8 ac_cv_sizeof_voidp=4 before: $ grep T_FMT config.log int64_t_fmt='#define APR_INT64_T_FMT "lld"' off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' pid_t_fmt='#define APR_PID_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "llu"' after: $ grep T_FMT config.log int64_t_fmt='#define APR_INT64_T_FMT "lld" off_t_fmt='#define APR_OFF_T_FMT "lld"' pid_t_fmt='#define APR_PID_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "llu"' OpenBSD/sparc64: $ grep ^ac_cv_sizeof config.log ac_cv_sizeof_char=1 ac_cv_sizeof_ino_t=8 ac_cv_sizeof_int=4 ac_cv_sizeof_long=8 ac_cv_sizeof_long_long=8 ac_cv_sizeof_off_t=8 ac_cv_sizeof_pid_t=4 ac_cv_sizeof_short=2 ac_cv_sizeof_size_t=8 ac_cv_sizeof_ssize_t=8 ac_cv_sizeof_struct_iovec=16 ac_cv_sizeof_voidp=8 before: $ grep T_FMT config.log int64_t_fmt='#define APR_INT64_T_FMT "ld"' off_t_fmt='#define APR_OFF_T_FMT "ld"' pid_t_fmt='#define APR_PID_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' after: $ grep T_FMT config.log int64_t_fmt='#define APR_INT64_T_FMT "ld"' off_t_fmt='#define APR_OFF_T_FMT "lld"' pid_t_fmt='#define APR_PID_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "lu"' OpenBSD/armv7: $ grep ^ac_cv_sizeof config.log ac_cv_sizeof_char=1 ac_cv_sizeof_ino_t=8 ac_cv_sizeof_int=4 ac_cv_sizeof_long=4 ac_cv_sizeof_long_long=8 ac_cv_sizeof_off_t=8 ac_cv_sizeof_pid_t=4 ac_cv_sizeof_short=2 ac_cv_sizeof_size_t=4 ac_cv_sizeof_ssize_t=4 ac_cv_sizeof_struct_iovec=8 ac_cv_sizeof_voidp=4 before: $ grep T_FMT config.log int64_t_fmt='#define APR_INT64_T_FMT "lld"' off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' pid_t_fmt='#define APR_PID_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "llu"' after: $ grep T_FMT config.log int64_t_fmt='#define APR_INT64_T_FMT "lld"' off_t_fmt='#define APR_OFF_T_FMT "lld"' pid_t_fmt='#define APR_PID_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' uint64_t_fmt='#define APR_UINT64_T_FMT "llu"'