From 849252c6a48b428dde3ad8930b40a2bdf9874cb7 Mon Sep 17 00:00:00 2001 From: Christian Göttsche Date: Thu, 6 Jun 2024 16:36:40 +0200 Subject: Add format attribute to log function and adjust format specifiers Annotate the common logging function sp_log_msgf() with the format attribute so compilers can check the used format string and passed arguments for discrepancies. Adjust the lineno printing by using %zu and the type size_t consistently. --- src/sp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp_config.c') diff --git a/src/sp_config.c b/src/sp_config.c index 2d2631a..de58c2a 100644 --- a/src/sp_config.c +++ b/src/sp_config.c @@ -90,7 +90,7 @@ zend_result sp_process_rule(sp_parsed_keyword *parsed_rule, const sp_config_keyw if (!found_kw) { zend_string *kwname = zend_string_init(kw->kw, kw->kwlen, 0); - sp_log_err("config", "Unexpected keyword '%s' on line %d", ZSTR_VAL(kwname), kw->lineno); + sp_log_err("config", "Unexpected keyword '%s' on line %zu", ZSTR_VAL(kwname), kw->lineno); zend_string_release_ex(kwname, 0); return FAILURE; } -- cgit v1.3