Add 32-bit disclaimer and fix MSVC x86 warnings - Move 32-bit warning to top of README with strong disclaimer - Add static_cast<size_t> to fix truncation warnings on 32-bit MSVC Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
diff --git a/README.md b/README.md index 44b71f0..31934dc 100644 --- a/README.md +++ b/README.md
@@ -10,6 +10,9 @@ > [!IMPORTANT] > This library uses 'blocking' socket I/O. If you are looking for a library with 'non-blocking' socket I/O, this is not the one that you want. +> [!WARNING] +> 32-bit platforms are **NOT supported**. Use at your own risk. The library may compile on 32-bit targets, but no security review has been conducted for 32-bit environments. Integer truncation and other 32-bit-specific issues may exist. **Security reports that only affect 32-bit platforms will be closed without action.** The maintainer does not have access to 32-bit environments for testing or fixing issues. CI includes basic compile checks only, not functional or security testing. + ## Main Features - HTTP Server/Client @@ -1545,11 +1548,6 @@ > [!NOTE] > Windows 8 or lower, Visual Studio 2015 or lower, and Cygwin and MSYS2 including MinGW are neither supported nor tested. -### 32-bit - -> [!NOTE] -> 32-bit platforms are not officially supported, but should work for basic usage. CI includes build checks for 32-bit Windows (MSVC x86), Linux x86, and ARM 32-bit to catch regressions. - ## License MIT license (© 2026 Yuji Hirose)
diff --git a/httplib.h b/httplib.h index 935c812..7070416 100644 --- a/httplib.h +++ b/httplib.h
@@ -2781,7 +2781,7 @@ std::advance(it, static_cast<ssize_t>(id)); if (it != rng.second) { if (is_numeric(it->second)) { - return std::strtoull(it->second.data(), nullptr, 10); + return static_cast<size_t>(std::strtoull(it->second.data(), nullptr, 10)); } else { is_invalid_value = true; } @@ -8221,7 +8221,8 @@ assert(r.first <= r.second && r.second < static_cast<ssize_t>(content_length)); (void)(content_length); - return std::make_pair(r.first, static_cast<size_t>(r.second - r.first) + 1); + return std::make_pair(static_cast<size_t>(r.first), + static_cast<size_t>(r.second - r.first) + 1); } inline std::string make_content_range_header_field(