From: Assaf Gordon Date: Thu, 10 Jul 2014 18:42:02 +0000 (+0100) Subject: localename: avoid -Wsuggest-attribute={const,pure} warnings X-Git-Tag: v1.0~7337 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=cfd8172b77120cb7002907af99e33af882097fc6;p=gnulib.git localename: avoid -Wsuggest-attribute={const,pure} warnings * lib/localename.c (string_has): Tag internal function as pure. * lib/localename.h (gl_locale_name_default): Tag extern declaration as const when appropriate. --- diff --git a/ChangeLog b/ChangeLog index 4e8a5d334f..6c465134aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-07-10 Assaf Gordon + + localename: avoid -Wsuggest-attribute={const,pure} warnings + * lib/localename.c (string_has): Tag internal function as pure. + * lib/localename.h (gl_locale_name_default): Tag extern declaration + as const when appropriate. + 2014-07-10 Eli Zaretskii nl_langinfo: Fix last change. diff --git a/lib/localename.c b/lib/localename.c index faf3f92522..9b6f67c55c 100644 --- a/lib/localename.c +++ b/lib/localename.c @@ -2515,7 +2515,7 @@ gl_locale_name_from_win32_LCID (LCID lcid) /* A hash function for NUL-terminated char* strings using the method described by Bruno Haible. See http://www.haible.de/bruno/hashfunc.html. */ -static size_t +static size_t _GL_ATTRIBUTE_PURE string_hash (const void *x) { const char *s = (const char *) x; diff --git a/lib/localename.h b/lib/localename.h index c73dfa83a4..687f1dd4fb 100644 --- a/lib/localename.h +++ b/lib/localename.h @@ -85,8 +85,12 @@ extern const char * gl_locale_name_environ (int category, const char *categoryna not require such a facility." The result must not be freed; it is statically allocated. */ -extern const char * gl_locale_name_default (void); - +extern const char * gl_locale_name_default (void) +#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE \ + || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__) + _GL_ATTRIBUTE_CONST +#endif + ; #ifdef __cplusplus }