GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Compiler warnings with `-Wundef`. · Issue #29138 · numpy/numpy

Compiler warnings with -Wundef. #29138

New issue
Copy link
New issue
Copy link
Closed
#29216
Closed
Compiler warnings with -Wundef.#29138
#29216
Copy link

Description

@charris
charris
opened on Jun 7, 2025
Issue body actions

We are using undefined macros in several places.

[56/359] Compiling C object numpy/_core/_struct_ufunc_tests.cpython-313-x86_64-linux-gnu.so.p/src_umath__struct_ufunc_tests.c.o
../numpy/_core/src/umath/_struct_ufunc_tests.c: In function ‘PyInit__struct_ufunc_tests’:
../numpy/_core/src/umath/_struct_ufunc_tests.c:160:5: warning: ‘Py_GIL_DISABLED’ is not defined, evaluates to ‘0’ [-Wundef]
  160 | #if Py_GIL_DISABLED
      |     ^~~~~~~~~~~~~~~

many places. This is a choice by Python to not define the macro for builds without free threading, but we might want to put a guard on it just to avoid the noise.

../numpy/_core/include/numpy/npy_common.h:504:20: warning: ‘NPY_ULONG’ is not defined, evaluates to ‘0’ [-Wundef]
  504 | #define NPY_UINT64 NPY_ULONG
      |                    ^~~~~~~~~
../numpy/_core/src/multiarray/descriptor.c:2098:22: note: in expansion of macro ‘NPY_UINT64’
 2098 | #if NPY_ULONGLONG == NPY_UINT64
      |                      ^~~~~~~~~~

Probably came about when we dropped the old header. Should be defined in numpyconfig.h

[352/359] Compiling C object numpy/random/_common.cpython-313-x86_64-linux-gnu.so.p/meson-generated_numpy_random__common.pyx.c.o
numpy/random/_common.cpython-313-x86_64-linux-gnu.so.p/numpy/random/_common.pyx.c:2814:35: warning: ‘CYTHON_PROFILE’ is not defined, evaluates to ‘0’ [-Wundef]
 2814 | #if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)

Probably a Cython choice not to define the macro.

Also in a test:

limited_api_latest.c:1:23: error: ‘PY_VERSION_HEX’ is not defined, evaluates to ‘0’ [-Werror=undef]
    1 | #if Py_LIMITED_API != PY_VERSION_HEX & 0xffff0000
      |                       ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Probably failure to import Python.h

Activity

  1. seberg
    added a commit that references this issue on Jun 17, 2025

    MAINT: Fix some undef warnings

    8fd41eb
  2. charris
    added a commit that references this issue on Jun 17, 2025

    MAINT: Fix some undef warnings (#29216)

    03d5730
  3. charris
    closed this as completedin #29216on Jun 17, 2025
  4. joy2myself
    added a commit that references this issue on Jul 21, 2025

    ENH: Convert unary from C universal intrinsics to C++ using Highway (#19

    3f5dccf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.