Skip to content

Lots of new compiler warnings #124064

@sobolevn

Description

@sobolevn
In file included from ./Include/internal/pycore_global_objects.h:12:
./Include/internal/pycore_gc.h:230:21: warning: implicit conversion changes signedness: 'int' to 'uintptr_t' (aka 'unsigned long') [-Wsign-conversion]
    gc->_gc_prev &= ~_PyGC_PREV_MASK_FINALIZED;
                 ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./Include/internal/pycore_code.h:13:
./Include/internal/pycore_backoff.h:78:66: warning: implicit conversion loses integer precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wimplicit-int-conversion]
        return make_backoff_counter((1 << (counter.backoff + 1)) - 1, counter.backoff + 1);
               ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from ./Include/internal/pycore_mimalloc.h:45:
./Include/internal/mimalloc/mimalloc/internal.h:489:84: warning: implicit conversion changes signedness: 'int' to 'mi_thread_free_t' (aka 'unsigned long') [-Wsign-conversion]
  return (mi_block_t*)(mi_atomic_load_relaxed(&((mi_page_t*)page)->xthread_free) & ~3);
                                                                                 ~ ^~
./Include/internal/mimalloc/mimalloc/internal.h:508:29: warning: implicit conversion changes signedness: 'int' to 'mi_thread_free_t' (aka 'unsigned long') [-Wsign-conversion]
  return (mi_block_t*)(tf & ~0x03);
                          ~ ^~~~~
./Include/internal/mimalloc/mimalloc/internal.h:806:10: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
  return __builtin_clzl(x);
  ~~~~~~ ^~~~~~~~~~~~~~~~~
./Include/internal/mimalloc/mimalloc/internal.h:814:10: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
  return __builtin_ctzl(x);
  ~~~~~~ ^~~~~~~~~~~~~~~~~
./Modules/getpath.c:264:48: warning: implicit conversion changes signedness: 'Py_ssize_t' (aka 'long') to 'unsigned long' [-Wsign-conversion]
    wchar_t **parts = (wchar_t **)PyMem_Malloc(n * sizeof(wchar_t *));
                                               ^ ~
./Modules/getpath.c:269:22: warning: implicit conversion changes signedness: 'Py_ssize_t' (aka 'long') to 'unsigned long' [-Wsign-conversion]
    memset(parts, 0, n * sizeof(wchar_t *));
                     ^ ~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_string.h:77:33: note: expanded from macro 'memset'
                __builtin___memset_chk (dest, __VA_ARGS__, __darwin_obsz0 (dest))
                                              ^~~~~~~~~~~
./Modules/getpath.c:295:61: warning: implicit conversion changes signedness: 'Py_ssize_t' (aka 'long') to 'unsigned long' [-Wsign-conversion]
    wchar_t *final = cchFinal > 0 ? (wchar_t *)PyMem_Malloc(cchFinal * sizeof(wchar_t)) : NULL;
                                                            ^~~~~~~~ ~
./Modules/getpath.c:318:57: warning: implicit conversion changes signedness: 'Py_ssize_t' (aka 'long') to 'size_t' (aka 'unsigned long') [-Wsign-conversion]
            } else if (_Py_add_relfile(final, parts[i], cchFinal) < 0) {
                       ~~~~~~~~~~~~~~~                  ^~~~~~~~
./Modules/getpath.c:385:63: warning: implicit conversion changes signedness: 'size_t' (aka 'unsigned long') to 'Py_ssize_t' (aka 'long') [-Wsign-conversion]
    wchar_t *wbuffer = _Py_DecodeUTF8_surrogateescape(buffer, cb, &len);
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         ^~
./Modules/getpath.c:663:43: warning: implicit conversion changes signedness: 'size_t' (aka 'unsigned long') to 'Py_ssize_t' (aka 'long') [-Wsign-conversion]
            u = PyUnicode_FromWideChar(w, len);
                ~~~~~~~~~~~~~~~~~~~~~~    ^~~
./Modules/getpath.c:707:43: warning: implicit conversion changes signedness: 'size_t' (aka 'unsigned long') to 'Py_ssize_t' (aka 'long') [-Wsign-conversion]
            u = PyUnicode_FromWideChar(w, len);
                ~~~~~~~~~~~~~~~~~~~~~~    ^~~
13 warnings generated.

Related #123020

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-build

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy