https://bugzilla.redhat.com/show_bug.cgi?id=2261448



--- Comment #8 from Petr Pisar <[email protected]> ---
First error reported in the build.log is:

In file included from Curses.c:434:
CursesWide.c: In function ‘c_wstr2sv’:
CursesWide.c:84:15: error: assignment to ‘wint_t *’ {aka ‘unsigned int *’} from
incompatible pointer type ‘wchar_t *’ {aka ‘long int *’}
[-Wincompatible-pointer-types]
   84 |     for (ws_p = ws; *ws_p; ws_p++) {
      |               ^

The variables are declared like this:

static void
c_wstr2sv(SV *      const sv,
          wchar_t * const ws) {
/*----------------------------------------------------------------------------
  Set SV to a Perl string holding a given wide string
-----------------------------------------------------------------------------*/
    wint_t *ws_p;
    int need_utf8 = 0;
    size_t ws_len = wcslen(ws);

and used like this (the line from the error message):

    for (ws_p = ws; *ws_p; ws_p++) {

C17 standard in 7.29.1 section defines that wint_t is an integer which can hold
any value of the extended character set (i.e. wchar_t) and at least one value
which is not representable in the extended character set (i.e. WEOF). That
means that size of wint_t cannot be less than size of wchar_t. Here on i686
"unsigned int" unsigned 32-bit and "long int" is signed 32-bit. While the
conversion of the extended character value could be preserved (e.g. the
extended charcter set ranges from 0 to 2^21), reinterpreting a wchar_t by a
dereferencing a pointer to a wint_t could mangle the sign because the compiler
thinks that the type have a different rank.

Either it's a bug in GCC, or something incorrectly redigined the types, or it
works as intended and one only need to explicitly cast "ws_p = (wint_t*)ws". I
would the have dig deeper.


-- 
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2261448

Report this comment as SPAM: 
https://bugzilla.redhat.com/enter_bug.cgi?product=Bugzilla&format=report-spam&short_desc=Report%20of%20Bug%202261448%23c8
--
_______________________________________________
perl-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to