Skip to content

Implicit signedness conversion in PyFunctionFastCall #2729

@JustAnotherArchivist

Description

@JustAnotherArchivist

With Cython 0.29 with Python 3.7.1 on Debian Sid, I get the following error (with -Werror) when compiling pyfuse3:

[...]
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/pyfuse3.c -o build/temp.linux-x86_64-3.7/src/pyfuse3.o -I/usr/include/fuse3 -DFUSE_USE_VERSION=32 -Wall -Wextra -Wconversion -Wsign-compare -DPYFUSE3_VERSION="1.1" -Wno-unused-function -Wno-implicit-fallthrough -Wno-unused-function -Wno-unused-parameter -Werror -Wfatal-errors -Wno-error=unreachable-code -Werror=conversion -Werror=sign-compare
src/pyfuse3.c: In function ‘__pyx_pymod_exec_pyfuse3’:
src/pyfuse3.c:1845:73: error: conversion to ‘long unsigned int’ from ‘Py_ssize_t’ {aka ‘long int’} may change the sign of the result [-Werror=sign-conversion]
      (void)(__pyx_pyframe_localsplus_offset = PyFrame_Type.tp_basicsize - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
                                                                         ^
src/pyfuse3.c:47086:3: note: in expansion of macro ‘__Pxy_PyFrame_Initialize_Offsets’
   __Pxy_PyFrame_Initialize_Offsets();
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

According to python-llfuse/python-llfuse#21, this also happens with Cython 0.28 on macOS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions