This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: newlib-lmessages.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]