From: Sean Bright Date: Mon, 8 Mar 2021 20:06:00 +0000 (-0500) Subject: strings.h: ast_str_to_upper() and _to_lower() are not pure. X-Git-Tag: 18.3.0-rc1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4cd7a7d0bf8b69a9fdbabaab5b9c4fa48e42cbb;p=thirdparty%2Fasterisk.git strings.h: ast_str_to_upper() and _to_lower() are not pure. Because they modify their argument they are not pure functions and should not be marked as such, otherwise the compiler may optimize them away. ASTERISK-29306 #close Change-Id: Ibec03a08522dd39e8a137ece9bc6a3059dfaad5f --- diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h index e9d786c2f3..929cbf5256 100644 --- a/include/asterisk/strings.h +++ b/include/asterisk/strings.h @@ -1265,7 +1265,7 @@ static force_inline int attribute_pure ast_str_case_hash(const char *str) * * \retval str for convenience */ -static force_inline char *attribute_pure ast_str_to_lower(char *str) +static force_inline char *ast_str_to_lower(char *str) { char *str_orig = str; if (!str) { @@ -1286,7 +1286,7 @@ static force_inline char *attribute_pure ast_str_to_lower(char *str) * * \retval str for convenience */ -static force_inline char *attribute_pure ast_str_to_upper(char *str) +static force_inline char *ast_str_to_upper(char *str) { char *str_orig = str; if (!str) {