Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package belr for openSUSE:Factory checked in at 2023-04-16 19:13:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/belr (Old) and /work/SRC/openSUSE:Factory/.belr.new.19717 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "belr" Sun Apr 16 19:13:04 2023 rev:20 rq:1079759 version:5.2.51 Changes: -------- --- /work/SRC/openSUSE:Factory/belr/belr.changes 2023-01-17 17:36:30.217587734 +0100 +++ /work/SRC/openSUSE:Factory/.belr.new.19717/belr.changes 2023-04-16 19:13:23.401451178 +0200 @@ -1,0 +2,8 @@ +Sun Apr 16 13:14:58 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 5.2.51: + * Fix bug resulting in empty matches not being considered as + valid when enclosed within a selector. + * Fix build using flexisip flags + +------------------------------------------------------------------- Old: ---- belr-5.2.9.tar.bz2 New: ---- belr-5.2.51.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ belr.spec ++++++ --- /var/tmp/diff_new_pack.HiAwb7/_old 2023-04-16 19:13:23.773453327 +0200 +++ /var/tmp/diff_new_pack.HiAwb7/_new 2023-04-16 19:13:23.777453350 +0200 @@ -19,7 +19,7 @@ %define soname libbelr %define sover 1 Name: belr -Version: 5.2.9 +Version: 5.2.51 Release: 0 Summary: Language recognition library License: GPL-3.0-or-later ++++++ belr-5.2.9.tar.bz2 -> belr-5.2.51.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belr-5.2.9/CMakeLists.txt new/belr-5.2.51/CMakeLists.txt --- old/belr-5.2.9/CMakeLists.txt 2022-02-10 10:41:47.000000000 +0100 +++ new/belr-5.2.51/CMakeLists.txt 2023-02-23 18:42:08.000000000 +0100 @@ -101,7 +101,7 @@ list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds") endif() if(ENABLE_STRICT) - list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wextra" "-Wno-unused-parameter" "-fno-strict-aliasing") + list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wextra" "-Wunused-parameter" "-fno-strict-aliasing") CHECK_CXX_COMPILER_FLAG("-Wsuggest-override" SUGGEST_OVERRIDE) if(SUGGEST_OVERRIDE) list(APPEND STRICT_OPTIONS_CPP "-Wsuggest-override -Werror=suggest-override") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belr-5.2.9/include/belr/parser.h new/belr-5.2.51/include/belr/parser.h --- old/belr-5.2.9/include/belr/parser.h 2022-02-10 10:41:47.000000000 +0100 +++ new/belr-5.2.51/include/belr/parser.h 2023-02-23 18:42:08.000000000 +0100 @@ -26,6 +26,8 @@ #include <vector> #include <sstream> +#include "bctoolbox/defs.h" + #include "belr.h" // ============================================================================= @@ -70,7 +72,7 @@ mFunc(universal_pointer_cast<typename _functorT::first_argument_type>(obj), value); } template <typename _valueT> - inline void _invokeWithValue(_parserElementT obj, typename std::enable_if<std::is_convertible<_valueT, _parserElementT>::value, const std::string&>::type value){ + inline void _invokeWithValue(_parserElementT, typename std::enable_if<std::is_convertible<_valueT, _parserElementT>::value, const std::string&>::type){ // no op. } #if defined(_MSC_VER) @@ -89,13 +91,13 @@ mFunc(universal_pointer_cast<typename _functorT::first_argument_type>(obj), std::atof(value.c_str())); } template <typename _valueT> - inline void _invokeWithChild(_parserElementT obj, typename std::enable_if<std::is_convertible<_valueT, std::string>::value, _parserElementT>::type child){ + inline void _invokeWithChild(_parserElementT, typename std::enable_if<std::is_convertible<_valueT, std::string>::value, _parserElementT>::type){ } template <typename _valueT> - inline void _invokeWithChild(_parserElementT obj, typename std::enable_if<std::is_integral<_valueT>::value, _parserElementT>::type child){ + inline void _invokeWithChild(_parserElementT, typename std::enable_if<std::is_integral<_valueT>::value, _parserElementT>::type){ } template <typename _valueT> - inline void _invokeWithChild(_parserElementT obj, typename std::enable_if<std::is_floating_point<_valueT>::value, _parserElementT>::type child){ + inline void _invokeWithChild(_parserElementT, typename std::enable_if<std::is_floating_point<_valueT>::value, _parserElementT>::type){ } template <typename _valueT> inline void _invokeWithChild( @@ -162,7 +164,7 @@ return mHandlerCreateFunc(this->getRulename(), value.substr(begin, count)); } template <typename _funcT> - typename std::enable_if<std::is_convertible<_funcT, std::function<_derivedParserElementT()>>::value, _derivedParserElementT>::type _invoke(const std::string &value, size_t begin, size_t count){ + typename std::enable_if<std::is_convertible<_funcT, std::function<_derivedParserElementT()>>::value, _derivedParserElementT>::type _invoke(const std::string &, size_t, size_t){ return mHandlerCreateFunc(); } _createElementFn mHandlerCreateFunc; @@ -513,7 +515,7 @@ } template <typename _parserElementT> -inline void ParserContext<_parserElementT>::_endParse(const ParserLocalContext &localctx, const std::string &input, size_t begin, size_t count){ +inline void ParserContext<_parserElementT>::_endParse(const ParserLocalContext &localctx, const std::string &, size_t begin, size_t count){ if (localctx.mHandlerContext){ mHandlerStack.pop_back(); if (count!=std::string::npos && count>0){ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belr-5.2.9/src/belr.cpp new/belr-5.2.51/src/belr.cpp --- old/belr-5.2.9/src/belr.cpp 2022-02-10 10:41:47.000000000 +0100 +++ new/belr-5.2.51/src/belr.cpp 2023-02-23 18:42:08.000000000 +0100 @@ -17,11 +17,21 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* + * To troubleshoot parsing, un comment the two following defines to get _very_ verbose logs. + */ + +//#define BCTBX_DEBUG_MODE 1 +//#define BELR_DEBUG 1 + +#include <bctoolbox/defs.h> + #include "common.h" #include "binarystream.h" #include "belr/parser.h" #include "belr/belr.h" + using namespace std; namespace belr{ @@ -34,16 +44,16 @@ * instanciating anything.*/ class DummyParserContext : public ParserContextBase{ public: - virtual void beginParse(ParserLocalContext &ctx, const std::shared_ptr<Recognizer> &rec) override{ + virtual void beginParse(BCTBX_UNUSED(ParserLocalContext &ctx), BCTBX_UNUSED(const std::shared_ptr<Recognizer> &rec)) override{ } - virtual void endParse(const ParserLocalContext &ctx, const std::string &input, size_t begin, size_t count) override{ + virtual void endParse(BCTBX_UNUSED(const ParserLocalContext &ctx), BCTBX_UNUSED(const std::string &input), BCTBX_UNUSED(size_t begin), BCTBX_UNUSED(size_t count)) override{ } virtual std::shared_ptr<HandlerContextBase> branch() override{ return nullptr; } - virtual void merge(const std::shared_ptr<HandlerContextBase> &other) override{ + virtual void merge(BCTBX_UNUSED(const std::shared_ptr<HandlerContextBase> &other)) override{ } - virtual void removeBranch(const std::shared_ptr<HandlerContextBase> &other) override{ + virtual void removeBranch(BCTBX_UNUSED(const std::shared_ptr<HandlerContextBase> &other)) override{ } }; @@ -192,7 +202,7 @@ size_t match; #ifdef BELR_DEBUG - BCTBX_SLOGD<<<"Trying to match: "<<mName; + BCTBX_SLOGD<<"Trying to match: "<<mName; #endif ParserLocalContext hctx; @@ -256,7 +266,7 @@ } } -size_t CharRecognizer::_feed(ParserContextBase &ctx, const string &input, size_t pos){ +size_t CharRecognizer::_feed(BCTBX_UNUSED(ParserContextBase &ctx), const string &input, size_t pos){ int c = (unsigned char)input[pos]; if (mCaseSensitive){ return c == mToRecognize ? 1 : string::npos; @@ -264,7 +274,7 @@ return ::tolower(c) == mToRecognize ? 1 : string::npos; } -void CharRecognizer::_optimize(int recursionLevel){ +void CharRecognizer::_optimize(BCTBX_UNUSED(int recursionLevel)){ } @@ -313,14 +323,15 @@ if (mIsExclusive) return _feedExclusive(ctx, input, pos); size_t matched=0; - size_t bestmatch=0; + size_t bestmatch=string::npos; shared_ptr<HandlerContextBase> bestBranch; for (auto it=mElements.begin(); it!=mElements.end(); ++it){ shared_ptr<HandlerContextBase> br; br = ctx.branch(); matched=(*it)->feed(ctx, input, pos); - if (matched!=string::npos && matched>bestmatch) { + /* Matching 0 characters is considered as a valid match (string::npos is returned in case of no match) */ + if (matched!=string::npos && (matched>bestmatch || bestmatch == string::npos)) { bestmatch=matched; if (bestBranch) ctx.removeBranch(bestBranch); bestBranch=br; @@ -328,7 +339,6 @@ ctx.removeBranch(br); } } - if (bestmatch==0) return string::npos; if (bestmatch!=string::npos){ ctx.merge(bestBranch); } @@ -505,13 +515,13 @@ CharRange::CharRange(int begin, int end) : mBegin(begin), mEnd(end){ } -size_t CharRange::_feed(ParserContextBase &ctx, const string &input, size_t pos){ +size_t CharRange::_feed(BCTBX_UNUSED(ParserContextBase &ctx), const string &input, size_t pos){ int c = (unsigned char)input[pos]; if (c >= mBegin && c <= mEnd) return 1; return string::npos; } -void CharRange::_optimize(int recursionLevel){ +void CharRange::_optimize(BCTBX_UNUSED(int recursionLevel)){ } @@ -553,7 +563,7 @@ } -size_t Literal::_feed(ParserContextBase &ctx, const string& input, size_t pos){ +size_t Literal::_feed(BCTBX_UNUSED(ParserContextBase &ctx), const string& input, size_t pos){ size_t i; for(i=0;i<mLiteralSize;++i){ if (::tolower(input[pos+i])!=mLiteral[i]) return string::npos; @@ -570,7 +580,7 @@ mLiteralSize = mLiteral.size(); } -void Literal::_optimize(int recursionLevel){ +void Literal::_optimize(BCTBX_UNUSED(int recursionLevel)){ } @@ -601,7 +611,7 @@ return string::npos; } -void RecognizerPointer::_serialize(BinaryOutputStream &fstr){ +void RecognizerPointer::_serialize(BCTBX_UNUSED(BinaryOutputStream &fstr)){ bctbx_fatal("The RecognizerPointer is not supposed to be serialized."); } @@ -614,7 +624,7 @@ mRecognizer=r; } -void RecognizerPointer::_optimize(int recursionLevel){ +void RecognizerPointer::_optimize(BCTBX_UNUSED(int recursionLevel)){ /*do not call optimize() on the pointed value to avoid a loop. * The grammar will do it for all rules anyway*/ } @@ -646,7 +656,7 @@ mRecognizer=r; } -void RecognizerAlias::_optimize(int recursionLevel){ +void RecognizerAlias::_optimize(BCTBX_UNUSED(int recursionLevel)){ /*do not call optimize() on the pointed value to avoid a loop. * The grammar will do it for all rules anyway*/ } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belr-5.2.9/src/grammarbuilder.cpp new/belr-5.2.51/src/grammarbuilder.cpp --- old/belr-5.2.9/src/grammarbuilder.cpp 2022-02-10 10:41:47.000000000 +0100 +++ new/belr-5.2.51/src/grammarbuilder.cpp 2023-02-23 18:42:08.000000000 +0100 @@ -19,6 +19,7 @@ #include <fstream> +#include <bctoolbox/defs.h> #include <bctoolbox/logging.h> #include "belr/abnf.h" @@ -36,7 +37,7 @@ return make_shared<ABNFNumval>(); } -shared_ptr< Recognizer > ABNFNumval::buildRecognizer(const shared_ptr< Grammar >& grammar){ +shared_ptr< Recognizer > ABNFNumval::buildRecognizer(BCTBX_UNUSED(const shared_ptr< Grammar >& grammar)){ if (mIsRange){ return Utils::char_range(mValues[0],mValues[1]); }else{