This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
i18n: warnings patrol
- To: gcc-patches at gcc dot gnu dot org
- Subject: i18n: warnings patrol
- From: Zack Weinberg <zack at codesourcery dot com>
- Date: Sat, 20 Oct 2001 10:38:43 -0700
This patch squelches all the warnings in the intl subdirectory.
zw
* dcigettext.c: Don't use #elif.
* gettextP.h: Prototype nls_uint32 and locale_charset here.
Always define ZERO to 1 to avoid warnings (ZERO is used in
flexible-array-member declarations).
* loadmsgcat.c: Apply __extension__ to structure definitions
using C99 designated initializer syntax.
Do not prototype locale_charset here.
* localcharset.c: Prototype get_charset_aliases before use.
Get rid of STATIC nonsense.
===================================================================
Index: intl/dcigettext.c
--- intl/dcigettext.c 2001/10/12 17:24:30 1.1
+++ intl/dcigettext.c 2001/10/20 17:35:16
@@ -123,7 +123,8 @@ extern int errno;
#ifdef _LIBC
/* Rename the non ANSI C functions. This is required by the standard
because some ANSI C functions will require linking with this object
- file and the name space must not be polluted. */
+ file and the name space must not be polluted.
+ GCC LOCAL: Don't use #elif. */
# define getcwd __getcwd
# ifndef stpcpy
# define stpcpy __stpcpy
@@ -133,8 +134,10 @@ extern int errno;
# if !defined HAVE_GETCWD
char *getwd ();
# define getcwd(buf, max) getwd (buf)
-# elif !defined HAVE_DECL_GETCWD
+# else
+# if !defined HAVE_DECL_GETCWD
char *getcwd ();
+# endif
# endif
# ifndef HAVE_STPCPY
static char *stpcpy PARAMS ((char *dest, const char *src));
===================================================================
Index: intl/gettextP.h
--- intl/gettextP.h 2001/10/12 17:24:30 1.4
+++ intl/gettextP.h 2001/10/20 17:35:16
@@ -63,6 +63,8 @@
# include <byteswap.h>
# define SWAP(i) bswap_32 (i)
#else
+/* GCC LOCAL: Prototype first to avoid warnings. */
+static inline nls_uint32 SWAP PARAMS ((nls_uint32));
static inline nls_uint32
SWAP (i)
nls_uint32 i;
@@ -144,12 +146,13 @@ struct loaded_domain
};
/* We want to allocate a string at the end of the struct. But ISO C
- doesn't allow zero sized arrays. */
-#ifdef __GNUC__
-# define ZERO 0
-#else
+ doesn't allow zero sized arrays.
+ GCC LOCAL: Always use 1, to avoid warnings. */
+/*#ifdef __GNUC__*/
+/*# define ZERO 0*/
+/*#else*/
# define ZERO 1
-#endif
+/*#endif*/
/* A set of settings bound to a message domain. Used to store settings
from bindtextdomain() and bind_textdomain_codeset(). */
@@ -189,6 +192,10 @@ char *_nl_find_msg PARAMS ((struct loade
const char *msgid, size_t *lengthp))
internal_function;
+/* GCC LOCAL: This prototype moved here from next to its
+ use in loadmsgcat.c. */
+extern const char *locale_charset PARAMS ((void)) internal_function;
+
#ifdef _LIBC
extern char *__gettext PARAMS ((const char *__msgid));
extern char *__dgettext PARAMS ((const char *__domainname,
===================================================================
Index: intl/loadmsgcat.c
--- intl/loadmsgcat.c 2001/10/12 17:24:30 1.5
+++ intl/loadmsgcat.c 2001/10/20 17:35:16
@@ -136,13 +136,14 @@ int _nl_msg_cat_cntr;
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
/* These structs are the constant expression for the germanic plural
- form determination. It represents the expression "n != 1". */
-static const struct expression plvar =
+ form determination. It represents the expression "n != 1".
+ GCC LOCAL: Use __extension__ to suppress -Wtraditional warnings. */
+__extension__ static const struct expression plvar =
{
.nargs = 0,
.operation = var,
};
-static const struct expression plone =
+__extension__ static const struct expression plone =
{
.nargs = 0,
.operation = num,
@@ -151,7 +152,7 @@ static const struct expression plone =
.num = 1
}
};
-static struct expression germanic_plural =
+__extension__ static struct expression germanic_plural =
{
.nargs = 2,
.operation = not_equal,
@@ -271,7 +272,6 @@ _nl_init_domain_conv (domain_file, domai
outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string;
# else
# if HAVE_ICONV
- extern const char *locale_charset (void);
outcharset = locale_charset ();
# endif
# endif
===================================================================
Index: intl/localcharset.c
--- intl/localcharset.c 2001/10/12 17:24:30 1.1
+++ intl/localcharset.c 2001/10/20 17:35:16
@@ -77,6 +77,9 @@
ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
static const char * volatile charset_aliases;
+/* GCC LOCAL: Static function prototypes. */
+static const char *get_charset_aliases PARAMS ((void));
+
/* Return a pointer to the contents of the charset.alias file. */
static const char *
get_charset_aliases ()
@@ -194,11 +197,9 @@ get_charset_aliases ()
into one of the canonical names listed in config.charset.
The result must not be freed; it is statically allocated.
If the canonical name cannot be determined, the result is a non-canonical
- name. */
+ name.
+ GCC LOCAL: Get rid of STATIC nonsense. */
-#ifdef STATIC
-STATIC
-#endif
const char *
locale_charset ()
{