[patch] newlib/libc/locale/lmessages.c:52: warning: excess elements in struct initializer

Ralf Corsepius ralf.corsepius@rtems.org
Wed Jul 20 09:53:00 GMT 2011


Hi,

I am facing the warning above.

AFAICT, the origin is an inconsistency on how 
__HAVE_LOCALE_INFO_EXTENDED__ is being used in
lmessages.c and lmessages.h:

* libc/locale/lmessages.c:
static const struct lc_messages_T _C_messages_locale = {
         "^[yY]" ,       /* yesexpr */
         "^[nN]" ,       /* noexpr */
         "yes" ,         /* yesstr */
         "no" ,          /* nostr */
         "ASCII"         /* codeset */
#ifdef __HAVE_LOCALE_INFO_EXTENDED__
         , L"^[yY]" ,    /* wyesexpr */
         L"^[nN]" ,      /* wnoexpr */
         L"yes" ,        /* wyesstr */
         L"no"           /* wnostr */
#endif
};


* libc/locale/lmessages.h:
struct  lc_messages_T {
         const char      *yesexpr;
         const char      *noexpr;
         const char      *yesstr;
         const char      *nostr;
#ifdef __HAVE_LOCALE_INFO_EXTENDED__
         const char      *codeset;        /* codeset for mbtowc 
conversion */
         const wchar_t   *wyesexpr;
         const wchar_t   *wnoexpr;
         const wchar_t   *wyesstr;
         const wchar_t   *wnostr;
#endif
};

=> AFAIU, one of these __HAVE_LOCALE_INFO_EXTENDED__ is misplaced and 
should be moved.

My guess is the define in lmessages.c should be "moved up", before 
codeset. Patch enclosed below.

Ralf
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: newlib-lmessages.patch
URL: <http://sourceware.org/pipermail/newlib/attachments/20110720/a8cb70a3/attachment.ksh>


More information about the Newlib mailing list