From 294d22c8d6678c9fee6a68f9c2acd40b4eab9a4f Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Mon, 11 Apr 2016 17:00:26 +0200 Subject: [PATCH] cfg.mk: Get rid of quotation tricks To prevent the error messages in cfg.mk from triggering the very same rules they're supposed to explain, we split the message in the middle of a symbol name, ending up with stuff like 'I am a me'ssage Instead of relying on these quotation tricks, simply exclude cfg.mk from the relevant checks. --- cfg.mk | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/cfg.mk b/cfg.mk index 5e27726821..fccb45a3cd 100644 --- a/cfg.mk +++ b/cfg.mk @@ -308,7 +308,7 @@ sc_flags_usage: | grep -c '\(long\|unsigned\) flags')" != 4 && \ { echo '$(ME): new API should use "unsigned int flags"' 1>&2; \ exit 1; } || : - @prohibit=' flags ''ATTRIBUTE_UNUSED' \ + @prohibit=' flags ATTRIBUTE_UNUSED' \ halt='flags should be checked with virCheckFlags' \ $(_sc_search_regexp) @prohibit='^[^@]*([^d] (int|long long)|[^dg] long) flags[;,)]' \ @@ -351,8 +351,8 @@ sc_prohibit_mkstemp: # access with X_OK accepts directories, but we can't exec() those. # access with F_OK or R_OK is okay, though. sc_prohibit_access_xok: - @prohibit='access''(at)? *\(.*X_OK' \ - halt='use virFileIsExecutable instead of access''(,X_OK)' \ + @prohibit='access(at)? *\(.*X_OK' \ + halt='use virFileIsExecutable instead of access(,X_OK)' \ $(_sc_search_regexp) # Similar to the gnulib maint.mk rule for sc_prohibit_strcmp @@ -361,7 +361,7 @@ snp_ = strncmp *\(.+\) sc_prohibit_strncmp: @prohibit='! *strncmp *\(|\<$(snp_) *[!=]=|[!=]= *$(snp_)' \ exclude=':# *define STR(N?EQLEN|PREFIX)\(' \ - halt='use STREQLEN or STRPREFIX instead of str''ncmp' \ + halt='use STREQLEN or STRPREFIX instead of strncmp' \ $(_sc_search_regexp) # strtol and friends are too easy to misuse @@ -379,7 +379,7 @@ sc_prohibit_strtol: # But for plain %s, virAsprintf is overkill compared to strdup. sc_prohibit_asprintf: @prohibit='\' \ - halt='use virAsprintf, not as'printf \ + halt='use virAsprintf, not asprintf' \ $(_sc_search_regexp) @prohibit='virAsprintf.*, *"%s",' \ halt='use VIR_STRDUP instead of virAsprintf with "%s"' \ @@ -406,7 +406,7 @@ sc_prohibit_risky_id_promotion: # since gnulib has more guarantees for snprintf portability sc_prohibit_sprintf: @prohibit='\<[s]printf\>' \ - halt='use snprintf, not s'printf \ + halt='use snprintf, not sprintf' \ $(_sc_search_regexp) sc_prohibit_readlink: @@ -431,13 +431,13 @@ sc_prohibit_gettext_noop: $(_sc_search_regexp) sc_prohibit_VIR_ERR_NO_MEMORY: - @prohibit='\' \ - halt='use virReportOOMError, not V'IR_ERR_NO_MEMORY \ + @prohibit='\' \ + halt='use virReportOOMError, not VIR_ERR_NO_MEMORY' \ $(_sc_search_regexp) sc_prohibit_PATH_MAX: - @prohibit='\' \ - halt='dynamically allocate paths, do not use P'ATH_MAX \ + @prohibit='\' \ + halt='dynamically allocate paths, do not use PATH_MAX' \ $(_sc_search_regexp) # Use a subshell for each function, to give the optimal warning message. @@ -455,7 +455,7 @@ sc_prohibit_nonreentrant: sc_prohibit_select: @prohibit='\