bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #65957] gettext 0.22.5 fails to build with mingw due to wrong point


From: Frédéric
Subject: [bug #65957] gettext 0.22.5 fails to build with mingw due to wrong pointer type in localtime.c
Date: Fri, 5 Jul 2024 12:13:03 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?65957>

                 Summary: gettext 0.22.5 fails to build with mingw due to
wrong pointer type in localtime.c
                   Group: GNU gettext
               Submitter: halespa
               Submitted: ven. 05 juil. 2024 16:13:02
                Category: C
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: ven. 05 juil. 2024 16:13:02    By: Frédéric <halespa>
Wrong pointer type is reported by gcc 14.1 while compiling gettext 0.22.5 with
mingw. The attached patch needs to be applied to have gettext compile.

The issue is in localtime.c:66:

char **env = _environ;
wchar_t **wenv = _wenviron;
if (env != NULL)
  for (char *s = env; *s != NULL; s++)
    if (s[0] == 'T' && s[1] == 'Z' && s[2] == '=')
      s[0] = '$';
if (wenv != NULL)
  for (wchar_t *ws = wenv; *ws != NULL; ws++)
    if (ws[0] == L'T' && ws[1] == L'Z' && ws[2] == L'=')
      ws[0] = L'$';

s and ws must be char** and wchar_t**. Then, to access characters, we need to
prefix s and ws by *:
*s[0] and *ws[0]...







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65957>

_______________________________________________
Message posté via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]