jim 99/05/23 09:55:30
Modified: src Configure src/ap ap_snprintf.c Log: What the hell, we can determine the size of void * so just avoid any warnings in snprintf.c Revision Changes Path 1.348 +39 -8 apache-1.3/src/Configure Index: Configure =================================================================== RCS file: /export/home/cvs/apache-1.3/src/Configure,v retrieving revision 1.347 retrieving revision 1.348 diff -u -r1.347 -r1.348 --- Configure 1999/05/21 23:57:48 1.347 +++ Configure 1999/05/23 16:55:28 1.348 @@ -1847,14 +1847,17 @@ #################################################################### ## More building ap_config_auto.h ## -## We check to see if this OS and/or compiler supports long-long +## We check the sizeof various data types ## -echo " + checking for the long long data type" -if ./helpers/TestCompile sizeof "long long"; then - AP_LONGEST_LONG="long long" -else +echo " + checking sizeof various data types" +AP_TYPE_QUAD=`./helpers/TestCompile -r sizeof 'long long'` +if [ "x$AP_TYPE_QUAD" = "x" ]; then + AP_TYPE_QUAD="unknown_quad" AP_LONGEST_LONG="long" +else + AP_LONGEST_LONG="long long" fi + echo "" >>$AP_CONFIG_AUTO_H echo "/* determine: longest possible integer type */" >>$AP_CONFIG_AUTO_H echo "#ifndef AP_LONGEST_LONG" >>$AP_CONFIG_AUTO_H @@ -1864,11 +1867,17 @@ ## ## Now compare the sizes of off_t to long ## -echo " + determining if off_t is quad or long" AP_TYPE_OFF_T=`./helpers/TestCompile -r sizeof off_t` +if [ "x$AP_TYPE_OFF_T" = "x" ]; then + AP_TYPE_OFF_T="unknown_off_t" +fi + AP_TYPE_LONG=`./helpers/TestCompile -r sizeof long` -if [ "x$AP_TYPE_OFF_T" != "x" ] && [ "x$AP_TYPE_OFF_T" != "x$AP_TYPE_LONG" ] -then +if [ "x$AP_TYPE_LONG" = "x" ]; then + AP_TYPE_LONG="unknown_long" +fi + +if [ "x$AP_TYPE_OFF_T" != "x$AP_TYPE_LONG" ]; then echo "" >>$AP_CONFIG_AUTO_H echo "/* determine: is off_t a quad */" >>$AP_CONFIG_AUTO_H echo "#ifndef AP_OFF_T_IS_QUAD" >>$AP_CONFIG_AUTO_H @@ -1879,6 +1888,28 @@ echo "/* determine: is off_t a quad */" >>$AP_CONFIG_AUTO_H echo "#ifndef AP_OFF_T_IS_QUAD" >>$AP_CONFIG_AUTO_H echo "#undef AP_OFF_T_IS_QUAD" >>$AP_CONFIG_AUTO_H + echo "#endif" >>$AP_CONFIG_AUTO_H +fi + +## +## Now see of void * is as big as a quad (long long) +## +AP_TYPE_VOID_P=`./helpers/TestCompile -r sizeof 'void *'` +if [ "x$AP_TYPE_VOID_P" = "x" ]; then + AP_TYPE_VOID_P="unknown_void_p" +fi + +if [ "x$AP_TYPE_VOID_P" = "x$AP_TYPE_QUAD" ]; then + echo "" >>$AP_CONFIG_AUTO_H + echo "/* determine: is void * a quad */" >>$AP_CONFIG_AUTO_H + echo "#ifndef AP_VOID_P_IS_QUAD" >>$AP_CONFIG_AUTO_H + echo "#define AP_VOID_P_IS_QUAD 1" >>$AP_CONFIG_AUTO_H + echo "#endif" >>$AP_CONFIG_AUTO_H +else + echo "" >>$AP_CONFIG_AUTO_H + echo "/* determine: is void * a quad */" >>$AP_CONFIG_AUTO_H + echo "#ifndef AP_VOID_P_IS_QUAD" >>$AP_CONFIG_AUTO_H + echo "#undef AP_VOID_P_IS_QUAD" >>$AP_CONFIG_AUTO_H echo "#endif" >>$AP_CONFIG_AUTO_H fi 1.34 +10 -10 apache-1.3/src/ap/ap_snprintf.c Index: ap_snprintf.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/ap/ap_snprintf.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- ap_snprintf.c 1999/05/22 11:24:41 1.33 +++ ap_snprintf.c 1999/05/23 16:55:29 1.34 @@ -998,22 +998,22 @@ * If the pointer size is equal to or smaller than the size * of the largest unsigned int, we convert the pointer to a * hex number, otherwise we print "%p" to indicate that we - * don't handle "%p". Note that depending on the - * sizes of the various pointers and u_wide_int - * and u_widest_int, gcc will warn about the - * assignments, but we are actually OK. + * don't handle "%p". */ case 'p': - if (sizeof(char *) <= sizeof(u_wide_int)) { - ui_num = (u_wide_int) va_arg(ap, void *); - s = conv_p2(ui_num, 4, 'x', - &num_buf[NUM_BUF_SIZE], &s_len); - } - else if (sizeof(char *) <= sizeof(u_widest_int)) { +#ifdef AP_VOID_P_IS_QUAD + if (sizeof(void *) <= sizeof(u_widest_int)) { ui_quad = (u_widest_int) va_arg(ap, void *); s = conv_p2_quad(ui_quad, 4, 'x', &num_buf[NUM_BUF_SIZE], &s_len); } +#else + if (sizeof(void *) <= sizeof(u_wide_int)) { + ui_num = (u_wide_int) va_arg(ap, void *); + s = conv_p2(ui_num, 4, 'x', + &num_buf[NUM_BUF_SIZE], &s_len); + } +#endif else { s = "%p"; s_len = 2;