Created attachment 22336 [details] Fix APR_PID_T_FMT on Solaris Revision 553652 of configure.in introduced changes in printf format detection for size_t and ssize_t to branch 1.3 and trunk. There were two unwanted side effects, that break detection of format for pid_t on Solaris (and lead to lots of Compilation warnings for httpd 2.2.9). Problem 1: In the block setting pid_t_fmt for Solaris it got changed from pid_t_fmt='#define APR_PID_T_FMT "ld"' to pid_t_fmt="ld" That type of change was wanted for size_t and ssize_t, but is unwanted for pid_t, since later on in configure.in, the define style is still used, and the way pid_t_fmt is included in apr.h.in was not adjusted. Problem 2: the whole block of special system handling concerning format characters was moved around. Before it was located under the lines were the defaults for pid_t_fmt had been set, now it is located above, so any special setting gets overwritten by the defaults. The attached patch fixed it. Same file for 1.3 and trunk.
So, when you apply just this hunk: ---------------------------- @@ -1360,9 +1374,9 @@ ;; *-solaris*) if test "$ac_cv_sizeof_long" = "8"; then - pid_t_fmt="d" + pid_t_fmt='#define APR_PID_T_FMT "d"' else - pid_t_fmt="ld" + pid_t_fmt='#define APR_PID_T_FMT "ld"' fi ;; *aix4*|*aix5*) ---------------------------- It doesn't work, right?
Right, that hunk alone doesn't help, because later down in configure the variable pid_t_fmt gets overwritten.
Created attachment 22407 [details] This patch moves platform specific stuff to very end, like we had it in 1.2.x
Does the patch I just attached still do it for you? I moved that platform specific stuff to the very end.
This will work for the pid_t_fmt case, but not for the biggest part in that block. For size_t_fmt and ssize_t_fmt there is logic below the block but before the place you want to move it, that already uses the values. I think you can savely move the block down below the immediately following lines APR_CHECK_TYPES_COMPATIBLE(ssize_t, int, [ssize_t_fmt="d"]) APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"]) APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"]) APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"]) (and that might be more correct), but not further down. This is not far enough for the pid_t_fmt case :(
Some examples why you shouldn't move the whole block down: 1) size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\"" ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\"" Need to stay as the latest size_t_fmt/ssize_t_fmt manipulating statements. 2) AC_MSG_CHECKING([which format to use for apr_ssize_t]) if test -n "$ssize_t_fmt"; then # So we take this branch if we already determined ssize_t_fmt AC_MSG_RESULT(%$ssize_t_fmt) elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then ssize_t_fmt="d" AC_MSG_RESULT(%d) elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then ssize_t_fmt="ld" AC_MSG_RESULT(%ld) else # And now we complain, because we couldn't determine the format AC_ERROR([could not determine the proper format for apr_ssize_t]) fi Obviously this block (and the same for the size_t_fmt block) needs to stay below the special case settings too.
Comment on attachment 22407 [details] This patch moves platform specific stuff to very end, like we had it in 1.2.x This patch is incorrect.
Thanks for the quick reply. I'll resend your original fix to the development list, so that people can have a look.
You patch has gone into trunk - thank you! I'll be waiting for other developers to chime in before backporting to 1.3.x. Hopefully, it'll make it into 1.3.3.
Thanks for taking care. If it doesn't make it into 1.3.3 it's definitely not a showstopper and can wait for 1.3.4.
Fixed in trunk and 1.3.x. Thanks for your patch!
Looks good on solaris/amd64: include/apr.h:#define APR_PID_T_FMT "d"