Skip to content

Compilation warnings on 3.15 #1048

Description

@sobolevn

There are three warnings that I get on 3.15-dev:

      src/msgspec/_core.c:3691:24: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
       3691 |         if (x == (-1LL << 63)) {
            |                   ~~~~ ^
      src/msgspec/_core.c:10206:16: warning: '_PyLong_Sign' is deprecated [-Wdeprecated-declarations]
       10206 |     bool neg = _PyLong_Sign(obj) < 0;
             |                ^
      /Users/sobolev/.pyenv/versions/3.15-dev/include/python3.15/cpython/longobject.h:38:1: note: '_PyLong_Sign' has been explicitly marked deprecated here
         38 | Py_DEPRECATED(3.14) PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
            | ^
      /Users/sobolev/.pyenv/versions/3.15-dev/include/python3.15/pyport.h:261:54: note: expanded from macro 'Py_DEPRECATED'
        261 | #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
            |                                                      ^
      src/msgspec/_core.c:12037:19: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
       12037 |     if (x < (-1LL << 53)) return false;
             |              ~~~~ ^
      3 warnings and 1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1

Env:

» clang --version
Apple clang version 17.0.0 (clang-1700.6.3.2)
Target: arm64-apple-darwin24.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions