On Tue, Mar 12, 2019 at 1:59 PM William A Rowe Jr <wr...@rowe-clan.net> wrote:
> > One obvious flaw I had missed in my earlier list, the problem with > maintainer mode strictness and our APR_OFF_T_FMT warnings. > > I think the patch is as simple as prioritizing int over long... which > would be the same logic already in use for size_t etc. Could those on > affected platforms including the latest osx have a go at this configure > hack before I commit it? (Remember to ./buildconf after patching). > > If this doesn't consistently work, I believe we would want to create a > flavor of the APR_CHECK_TYPES_COMPATIBLE() macro to verify type and format > pattern against an actual strict printf() invocation. > Scratch that... it won't solve osx. sf and wuzhouhui already identified the exact darwin error; a.c:7:33: warning: format specifies type 'long' but the argument has type 'apr_off_t' (aka 'long long') [-Wformat] printf("%" APR_OFF_T_FMT "\n", a); Rereading the APR_CHECK_TYPES_COMPATIBLE logic, I misread it. We test and successively pass ssize_t as int compatible, followed by retesting and passing ssize_t as long compatible, so the resulting APR_SSIZE_T_FMT pattern is "ld". However, even that test is wonky as it relies on a gcc/icc internal nonstandard __builtin_types_compatible_p call. Try compile is our friend here, working on the more general fix to test that sizeof type $1 is sizeof type $2 and that the corresponding "d" "ld" "lld" param works in a strict printf.