From: Bruno Haible Date: Sat, 30 Mar 2019 11:05:10 +0000 (+0100) Subject: Update after gnulib changed. X-Git-Tag: v0.20~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81528ae5eccd139b985808a26b72afa5fb452737;p=thirdparty%2Fgettext.git Update after gnulib changed. --- diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c index 857a76d72..1cb0a90f0 100644 --- a/gettext-runtime/intl/localename.c +++ b/gettext-runtime/intl/localename.c @@ -2296,8 +2296,8 @@ gl_locale_name_from_win32_LANGID (LANGID langid) } return "wen"; case LANG_SOTHO: - /* calls - it "Sesotho sa Leboa"; according to + /* + calls it "Sesotho sa Leboa"; according to it's the same as Northern Sotho. */ diff --git a/gettext-runtime/intl/relocatable.c b/gettext-runtime/intl/relocatable.c index 5960608bb..afb1a276b 100644 --- a/gettext-runtime/intl/relocatable.c +++ b/gettext-runtime/intl/relocatable.c @@ -1,5 +1,5 @@ /* Provide relocatable packages. - Copyright (C) 2003-2006, 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2006, 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software: you can redistribute it and/or modify @@ -268,7 +268,7 @@ compute_curr_prefix (const char *orig_installprefix, } if (!same) break; - /* The last pathname component was the same. opi and cpi now point + /* The last pathname component was the same. rpi and cpi now point to the slash before it. */ rp = rpi; cp = cpi; @@ -282,23 +282,23 @@ compute_curr_prefix (const char *orig_installprefix, } { - size_t curr_prefix_len = cp - curr_installdir; - char *curr_prefix; + size_t computed_curr_prefix_len = cp - curr_installdir; + char *computed_curr_prefix; - curr_prefix = (char *) xmalloc (curr_prefix_len + 1); + computed_curr_prefix = (char *) xmalloc (computed_curr_prefix_len + 1); #ifdef NO_XMALLOC - if (curr_prefix == NULL) + if (computed_curr_prefix == NULL) { free (curr_installdir); return NULL; } #endif - memcpy (curr_prefix, curr_installdir, curr_prefix_len); - curr_prefix[curr_prefix_len] = '\0'; + memcpy (computed_curr_prefix, curr_installdir, computed_curr_prefix_len); + computed_curr_prefix[computed_curr_prefix_len] = '\0'; free (curr_installdir); - return curr_prefix; + return computed_curr_prefix; } } } diff --git a/gettext-runtime/intl/vasnprintf.c b/gettext-runtime/intl/vasnprintf.c index 423db91b3..02daf987e 100644 --- a/gettext-runtime/intl/vasnprintf.c +++ b/gettext-runtime/intl/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -4874,6 +4874,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ && !defined __UCLIBC__) \ || (defined __APPLE__ && defined __MACH__) \ + || defined __ANDROID__ \ || (defined _WIN32 && ! defined __CYGWIN__)) fbp[1] = '%'; fbp[2] = 'n'; @@ -4895,6 +4896,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, On Mac OS X 10.13 or newer, the use of %n in format strings in writable memory by default crashes the program, so we should avoid it in this situation. */ + /* On Android, we know that snprintf's return value conforms to + ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and + gl_SNPRINTF_TRUNCATION_C99 pass. + Therefore we can avoid using %n in this situation. + Starting on 2018-03-07, the use of %n in format strings + produces a fatal error (see + ), + so we should avoid it. */ /* On native Windows systems (such as mingw), we can avoid using %n because: - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, @@ -4908,7 +4917,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, Windows Vista, the use of %n in format strings by default crashes the program. See and - + So we should avoid %n in this situation. */ fbp[1] = '\0'; # endif diff --git a/gettext-runtime/intl/verify.h b/gettext-runtime/intl/verify.h index 36354359f..ecd8cdb09 100644 --- a/gettext-runtime/intl/verify.h +++ b/gettext-runtime/intl/verify.h @@ -26,7 +26,7 @@ here generates easier-to-read diagnostics when verify (R) fails. Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11. - This will likely be supported by future GCC versions, in C++ mode. + This is supported by GCC 6.1.0 and later, in C++ mode. Use this only with GCC. If we were willing to slow 'configure' down we could also use it with other compilers, but since this @@ -36,9 +36,7 @@ && !defined __cplusplus) # define _GL_HAVE__STATIC_ASSERT 1 #endif -/* The condition (99 < __GNUC__) is temporary, until we know about the - first G++ release that supports static_assert. */ -#if (99 < __GNUC__) && defined __cplusplus +#if (6 <= __GNUC__) && defined __cplusplus # define _GL_HAVE_STATIC_ASSERT 1 #endif diff --git a/gettext-runtime/libasprintf/vasnprintf.c b/gettext-runtime/libasprintf/vasnprintf.c index 423db91b3..02daf987e 100644 --- a/gettext-runtime/libasprintf/vasnprintf.c +++ b/gettext-runtime/libasprintf/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2018 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -4874,6 +4874,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ && !defined __UCLIBC__) \ || (defined __APPLE__ && defined __MACH__) \ + || defined __ANDROID__ \ || (defined _WIN32 && ! defined __CYGWIN__)) fbp[1] = '%'; fbp[2] = 'n'; @@ -4895,6 +4896,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, On Mac OS X 10.13 or newer, the use of %n in format strings in writable memory by default crashes the program, so we should avoid it in this situation. */ + /* On Android, we know that snprintf's return value conforms to + ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and + gl_SNPRINTF_TRUNCATION_C99 pass. + Therefore we can avoid using %n in this situation. + Starting on 2018-03-07, the use of %n in format strings + produces a fatal error (see + ), + so we should avoid it. */ /* On native Windows systems (such as mingw), we can avoid using %n because: - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, @@ -4908,7 +4917,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, Windows Vista, the use of %n in format strings by default crashes the program. See and - + So we should avoid %n in this situation. */ fbp[1] = '\0'; # endif