Compare commits

..

6 Commits

Author SHA1 Message Date
a142dfecda Call snprintf when available in posix_api.cpp.
Fixes https://github.com/boostorg/regex/issues/184.
2022-12-02 17:25:16 +00:00
c23e7b857a Add missing #include.
Fixes https://github.com/boostorg/regex/issues/183
2022-12-02 17:10:45 +00:00
3efc3f93c7 Merge pull request #166 from chrisse74/develop
Fix unused variable warnings
2022-12-02 17:05:13 +00:00
e5979ae1af Correct windows_gcc CI runner. 2022-06-27 09:14:55 +01:00
72f81888a5 Merge pull request #173 from boostorg/overflow_fix
Fix for numeric overflow found during fuzzing.
2022-04-08 17:22:08 +01:00
54a5ed8509 Fix unused variable warnings 2021-11-09 16:24:52 +01:00
4 changed files with 18 additions and 12 deletions

View File

@ -158,7 +158,7 @@ jobs:
run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }}
working-directory: ../boost-root/libs/regex/test
windows_gcc:
runs-on: windows-latest
runs-on: windows-2019
defaults:
run:
shell: cmd

View File

@ -190,8 +190,8 @@ public:
constexpr char_class_type mask_xdigit = char_class_type(1) << offset_xdigit;
constexpr char_class_type mask_underscore = char_class_type(1) << offset_underscore;
constexpr char_class_type mask_unicode = char_class_type(1) << offset_unicode;
constexpr char_class_type mask_any = char_class_type(1) << offset_any;
constexpr char_class_type mask_ascii = char_class_type(1) << offset_ascii;
//constexpr char_class_type mask_any = char_class_type(1) << offset_any;
//constexpr char_class_type mask_ascii = char_class_type(1) << offset_ascii;
constexpr char_class_type mask_horizontal = char_class_type(1) << offset_horizontal;
constexpr char_class_type mask_vertical = char_class_type(1) << offset_vertical;
@ -365,15 +365,15 @@ private:
static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2)
{
constexpr char_class_type mask_blank = char_class_type(1) << offset_blank;
constexpr char_class_type mask_space = char_class_type(1) << offset_space;
constexpr char_class_type mask_xdigit = char_class_type(1) << offset_xdigit;
constexpr char_class_type mask_underscore = char_class_type(1) << offset_underscore;
constexpr char_class_type mask_unicode = char_class_type(1) << offset_unicode;
//constexpr char_class_type mask_blank = char_class_type(1) << offset_blank;
//constexpr char_class_type mask_space = char_class_type(1) << offset_space;
//constexpr char_class_type mask_xdigit = char_class_type(1) << offset_xdigit;
//constexpr char_class_type mask_underscore = char_class_type(1) << offset_underscore;
//constexpr char_class_type mask_unicode = char_class_type(1) << offset_unicode;
constexpr char_class_type mask_any = char_class_type(1) << offset_any;
constexpr char_class_type mask_ascii = char_class_type(1) << offset_ascii;
constexpr char_class_type mask_horizontal = char_class_type(1) << offset_horizontal;
constexpr char_class_type mask_vertical = char_class_type(1) << offset_vertical;
//constexpr char_class_type mask_horizontal = char_class_type(1) << offset_horizontal;
//constexpr char_class_type mask_vertical = char_class_type(1) << offset_vertical;
static const ::UChar32 prop_name_table[] = {
/* any */ 'a', 'n', 'y',

View File

@ -21,6 +21,7 @@
#include <boost/config.hpp>
#include <boost/regex.hpp>
#include <boost/cregex.hpp>
#include <boost/cstdint.hpp>
#include <cstdio>
#if defined(BOOST_NO_STDC_NAMESPACE)
@ -176,7 +177,9 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
// We're converting an integer i to a string, and since i <= REG_E_UNKNOWN
// a five character string is *always* large enough:
//
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
#if BOOST_CXX_VERSION >= 201103
int r = (std::snprintf)(localbuf, 5, "%d", i);
#elif BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
int r = (::sprintf_s)(localbuf, 5, "%d", i);
#else
int r = (std::sprintf)(localbuf, "%d", i);
@ -188,7 +191,9 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
return std::strlen(localbuf) + 1;
}
}
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
#if BOOST_CXX_VERSION >= 201103
int r = (::snprintf)(localbuf, 5, "%d", 0);
#elif BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
int r = (::sprintf_s)(localbuf, 5, "%d", 0);
#else
int r = (std::sprintf)(localbuf, "%d", 0);

View File

@ -24,6 +24,7 @@
#include <boost/regex.hpp>
#include <boost/cregex.hpp>
#include <boost/cstdint.hpp>
#include <cstdio>
#include <cstring>