Skip to content

PY_NUMPY_BUFFER_FORMAT declared conditionally but used unconditionally #3

Open
@umlaeute

Description

@umlaeute

in pybuffer.cpp, the PY_NUMPY_BUFFER_FORMAT is defined only if PY_NUMPY is already defined:

py/source/pybuffer.cpp

Lines 31 to 37 in 35138a0

# if defined(PY_NUMPY)
# include <numpy/arrayobject.h>
# if _FLEXT_NEED_SAMPLE_CONV
# define PY_NUMPY_BUFFER_FORMAT "f"
# else
# define PY_NUMPY_BUFFER_FORMAT "d"
# endif

but later on, it is used even if PY_NUMPY is not defined:

view->format = (flags & PyBUF_FORMAT) ? (char *) PY_NUMPY_BUFFER_FORMAT : NULL;

this obviously break the build if PY_NUMPY is not defined...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions