[Asterisk-code-review] strings.h: ast_str_to_upper() and _to_lower() are not pure. (asterisk[master])

Sean Bright asteriskteam at digium.com
Mon Mar 8 14:12:28 CST 2021


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15578 )


Change subject: strings.h: ast_str_to_upper() and _to_lower() are not pure.
......................................................................

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
---
M include/asterisk/strings.h
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/78/15578/1

diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index e9d786c..929cbf5 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -1265,7 +1265,7 @@
  *
  * \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 @@
  *
  * \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) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15578
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ibec03a08522dd39e8a137ece9bc6a3059dfaad5f
Gerrit-Change-Number: 15578
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210308/92d66f15/attachment.html>


More information about the asterisk-code-review mailing list