summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Carson <toc@daybefore.net>2020-07-01 00:16:19 +0900
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2020-07-26 12:05:56 +0300
commit1db7c5e263173313c73e8f80f02aed49e2a47a7b (patch)
tree0e22e8a61d354377807d952e4909d529baf220db
parent87192af2df3e2acb27a2bb3a31a7ddc30d7161c9 (diff)
Don't declare mu_str_size_s() with the const attribute.
When this function is declared const or pure, clang at -O1 or higher optimizes away the call to mu_str_size_s() inside mu_str_size(), so that it ignores its argument and returns whatever is in mu_str_size_s()'s static buffer. Found when test-mu-str failed while testing an update of mu in OpenBSD's ports tree.
-rw-r--r--lib/utils/mu-str.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/mu-str.h b/lib/utils/mu-str.h
index 45867d7..f009a11 100644
--- a/lib/utils/mu-str.h
+++ b/lib/utils/mu-str.h
@@ -48,7 +48,7 @@ G_BEGIN_DECLS
* @return a string representation of the size; see above
* for what to do with it
*/
-const char* mu_str_size_s (size_t s) G_GNUC_CONST;
+const char* mu_str_size_s (size_t s);
char* mu_str_size (size_t s) G_GNUC_WARN_UNUSED_RESULT;