Skip to content

use of undeclared identifier 'SIZE_MAX' #460

@Andarwinux

Description

@Andarwinux

I'm sorry I couldn't find a smaller reproduction of this

mkdir test && cd test && export TEST=$(pwd)

git clone https://github.com/libssh2/libssh2.git && cd libssh2

cmake -GNinja -Bbuild -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$TEST/install -DBUILD_SHARED_LIBS=OFF -DCRYPTO_BACKEND=WinCNG -DENABLE_ZLIB_COMPRESSION=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF

ninja -C build install

cd $TEST

git clone https://github.com/aria2/aria2.git && cd aria2

export PKG_CONFIG_LIBDIR=$TEST/install/lib/pkgconfig

autoreconf -fi

./configure --enable-static --with-libssh2 --host=x86_64-w64-mingw32 --prefix=$TEST/install --disable-shared

make -j16

In file included from SSHSession.cc:35:
In file included from ./SSHSession.h:39:
In file included from ./a2netcompat.h:94:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/string:648:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/string_view:958:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/algorithm:1851:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/__algorithm/for_each.h:16:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/__ranges/movable_box.h:21:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/optional:1297:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/memory:944:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/__memory/inout_ptr.h:16:
In file included from /home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/__memory/shared_ptr.h:32:
/home/arch/workspace/toolchain/llvm-mingw/x86_64-w64-mingw32/include/c++/v1/__memory/unique_ptr.h:379:88: error: use of undeclared identifier 'SIZE_MAX'
  379 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __unique_ptr_array_bounds_stored() : __size_(SIZE_MAX) {}
      |                                                                                        ^
  CXX      AnnounceList.lo
  CXX      AnnounceTier.lo
1 error generated.

This happens in llvm-mingw nightly, and is caused by llvm/llvm-project@18df9d2 to be exact, if I replace SIZE_MAX with __SIZE_MAX__ it doesn't cause a problem, but that commit itself doesn't look wrong. I don't know why SIZE_MAX isn't defined, cstdint should end up include stdint.h from mingw.

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