From: Ryan Bloom Date: Thu, 22 Feb 2001 04:05:58 +0000 (+0000) Subject: Add a couple of GCC attribute tags to printf style functions. This also X-Git-Tag: 2.0.12~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e552aeb0e3220bd47562e5cd88c02038ca5a1a36;p=thirdparty%2Fapache%2Fhttpd.git Add a couple of GCC attribute tags to printf style functions. This also fixes a couple of mismatched parameters highlighted revealed by the attribute. Submitted by: Jon Travis git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88271 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index dd6495b65eb..1f69989f8a7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.12-dev + *) Add a couple of GCC attribute tags to printf style functions. + [Jon Travis ] + *) Add the correct language tag for interoperation with the Taiwanese versions of MSIE and Netscape. [Clive Lin ] PR#7142 diff --git a/include/util_filter.h b/include/util_filter.h index 33b27fdc146..8a0140c20ca 100644 --- a/include/util_filter.h +++ b/include/util_filter.h @@ -460,7 +460,8 @@ AP_DECLARE_NONSTD(int) ap_fputstrs(ap_filter_t *f, apr_bucket_brigade *bb, ...); * @param ... The argumets to use to fill out the format string * @deffunc int ap_fprintf(ap_filter_t *f, apr_bucket_brigade *bb, const char *fmt, ...) */ -AP_DECLARE_NONSTD(int) ap_fprintf(ap_filter_t *f, apr_bucket_brigade *bb, const char *fmt, ...); +AP_DECLARE_NONSTD(int) ap_fprintf(ap_filter_t *f, apr_bucket_brigade *bb, const char *fmt, ...) + __attribute__((format(printf,3,4))); #ifdef __cplusplus } diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 432059aecbf..150babfbf62 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -490,13 +490,13 @@ static const char *log_request_time(request_rec *r, char *a) static const char *log_request_duration(request_rec *r, char *a) { - return apr_psprintf(r->pool, "%ld", (apr_time_now() - r->request_time) + return apr_psprintf(r->pool, "%qd", (apr_time_now() - r->request_time) / APR_USEC_PER_SEC); } static const char *log_request_duration_microseconds(request_rec *r, char *a) { - return apr_psprintf(r->pool, "%ld", (apr_time_now() - r->request_time)); + return apr_psprintf(r->pool, "%qd", (apr_time_now() - r->request_time)); } /* These next two routines use the canonical name:port so that log