From d275f854fa5db3ef8538fb003a488aad5588ea58 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Fri, 7 Dec 2012 23:39:05 +0000 Subject: [PATCH] Add some __attribute__ for automatic format checking. Correct one catch in sed0.c. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1418556 13f79535-47bb-0310-9956-ffa450edef68 --- include/util_filter.h | 4 ++-- modules/filters/regexp.h | 3 ++- modules/filters/sed0.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/util_filter.h b/include/util_filter.h index 5f6f9afab6..8b3c7a8487 100644 --- a/include/util_filter.h +++ b/include/util_filter.h @@ -332,8 +332,8 @@ AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *filter, AP_DECLARE(apr_status_t) ap_pass_brigade_fchk(request_rec *r, apr_bucket_brigade *bucket, const char *fmt, - ...); - + ...) + __attribute__((format(printf,3,4))); /** * This function is used to register an input filter with the system. diff --git a/modules/filters/regexp.h b/modules/filters/regexp.h index 1e5a6269a0..6af89120d0 100644 --- a/modules/filters/regexp.h +++ b/modules/filters/regexp.h @@ -69,7 +69,8 @@ typedef struct _sed_comp_args { extern char *sed_compile(sed_commands_t *commands, sed_comp_args *compargs, char *ep, char *endbuf, int seof); -extern void command_errf(sed_commands_t *commands, const char *fmt, ...); +extern void command_errf(sed_commands_t *commands, const char *fmt, ...) + __attribute__((format(printf,2,3))); #define SEDERR_CGMES "command garbled: %s" #define SEDERR_SMMES "Space missing before filename: %s" diff --git a/modules/filters/sed0.c b/modules/filters/sed0.c index da47122ac0..c1f25dfe9a 100644 --- a/modules/filters/sed0.c +++ b/modules/filters/sed0.c @@ -275,7 +275,7 @@ comploop: } if(p > &commands->respace[RESIZE-1]) { - command_errf(commands, SEDERR_TMMES); + command_errf(commands, SEDERR_TMMES, commands->linebuf); return -1; } -- 2.40.0