Skip to content

GCC -Wstringop-overflow on new Handler(id) when compiling the extension module (Linux, GCC 13+) #696

Description

@linesight

Building the extension module on Linux emits -Wstringop-overflow warnings, all
of the same shape. Env: CEF Python 147.0, Python 3.14, GCC 15.2.0 (Ubuntu), CMake
build with -O3 -flto.

/usr/include/c++/15/bits/atomic_base.h:631:34: warning: ‘__atomic_fetch_add_4’ writing 4 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
  631 |       { return __atomic_fetch_add(&_M_i, __i, int(__m)); }
      |                                  ^
pyx_stage/cefpython_py314.cpp: In function ‘__pyx_f_...CreateResourceHandler’:
pyx_stage/cefpython_py314.cpp:114943:107: note: at offset 16 into destination object of size 16 allocated by ‘operator new’
114943 |   __pyx_v_resourceHandler = ((CefRefPtr<CefResourceHandler> )new ResourceHandler(__pyx_v_resourceHandlerId));

On CI where gcc 13 is used, also see the same warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions