From b62d3d21eb887b79ac13751123a503d971cdaf14 Mon Sep 17 00:00:00 2001 From: ihedvall Date: Sat, 1 Jul 2023 12:01:07 +0200 Subject: [PATCH] Minor build issue with auto_ptr warnings in Unix build --- .idea/vcs.xml | 1 - src/syslogflexer.cpp | 88 ++++++++++++++++++++++---------------------- src/syslogparser.cpp | 64 ++++++++++++++++---------------- src/syslogparser.hpp | 20 +++++----- src/unithelper.cpp | 2 +- 5 files changed, 87 insertions(+), 88 deletions(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 48e096d..94a25f7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,5 @@ - \ No newline at end of file diff --git a/src/syslogflexer.cpp b/src/syslogflexer.cpp index cd362c1..3daf4b7 100644 --- a/src/syslogflexer.cpp +++ b/src/syslogflexer.cpp @@ -1,7 +1,7 @@ -#line 1 "D:/projects/utillib/src/syslogflexer.cpp" +#line 2 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.cpp" #include -#line 4 "D:/projects/utillib/src/syslogflexer.cpp" +#line 5 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.cpp" #define YY_INT_ALIGNED short int @@ -368,7 +368,7 @@ typedef flex_uint8_t YY_CHAR; #include -inline int yyFlexLexer::yywrap() { return 1; } +int yyFlexLexer::yywrap() { return 1; } int yyFlexLexer::yylex() { LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" ); @@ -576,19 +576,19 @@ static const flex_int16_t yy_rule_linenum[31] = #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -#line 1 "D:/projects/utillib/src/syslogflexer.l" +#line 1 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" -#line 5 "D:/projects/utillib/src/syslogflexer.l" +#line 5 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" #include "syslogscanner.h" #undef YY_DECL #define YY_DECL int util::syslog::SyslogScanner::yylex(syslog::SyslogParser::value_type* yy_value) using token = util::syslog::SyslogParser::token; -#line 587 "D:/projects/utillib/src/syslogflexer.cpp" +#line 588 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.cpp" #define YY_NO_UNISTD_H 1 #define YY_NO_INPUT 1 -#line 591 "D:/projects/utillib/src/syslogflexer.cpp" +#line 592 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.cpp" #define INITIAL 0 #define PRI 1 @@ -615,7 +615,7 @@ static const flex_int16_t yy_rule_linenum[31] = #include /* %endif */ #endif - + #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif @@ -792,13 +792,13 @@ YY_DECL { /* %% [7.0] user's declarations go here */ -#line 30 "D:/projects/utillib/src/syslogflexer.l" +#line 30 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" -#line 33 "D:/projects/utillib/src/syslogflexer.l" +#line 33 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" yylval = yy_value; -#line 801 "D:/projects/utillib/src/syslogflexer.cpp" +#line 802 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.cpp" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -875,184 +875,184 @@ YY_DECL case 1: YY_RULE_SETUP -#line 35 "D:/projects/utillib/src/syslogflexer.l" +#line 35 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN(PRI); return '<';} YY_BREAK case 2: YY_RULE_SETUP -#line 38 "D:/projects/utillib/src/syslogflexer.l" +#line 38 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const auto num = std::stoi(yytext); yylval->build(num); return token::NUMBER;} YY_BREAK case 3: YY_RULE_SETUP -#line 42 "D:/projects/utillib/src/syslogflexer.l" +#line 42 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN(VERSION); return '>';} YY_BREAK case 4: YY_RULE_SETUP -#line 45 "D:/projects/utillib/src/syslogflexer.l" +#line 45 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" {const auto num = std::stoi(yytext); yylval->build(num); return token::NUMBER;} YY_BREAK case 5: YY_RULE_SETUP -#line 49 "D:/projects/utillib/src/syslogflexer.l" +#line 49 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN TIMESTAMP; yylval->build(" "); return token::SP;} YY_BREAK case 6: YY_RULE_SETUP -#line 53 "D:/projects/utillib/src/syslogflexer.l" +#line 53 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string time = yytext; yylval->build(time); return token::ISOTIME;} YY_BREAK case 7: YY_RULE_SETUP -#line 57 "D:/projects/utillib/src/syslogflexer.l" +#line 57 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN HOSTNAME; yylval->build(" "); return token::SP;} YY_BREAK case 8: YY_RULE_SETUP -#line 61 "D:/projects/utillib/src/syslogflexer.l" +#line 61 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string name = yytext; yylval->build(name); return token::NAME;} YY_BREAK case 9: YY_RULE_SETUP -#line 65 "D:/projects/utillib/src/syslogflexer.l" +#line 65 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN APPNAME; yylval->build(" "); return token::SP;} YY_BREAK case 10: YY_RULE_SETUP -#line 69 "D:/projects/utillib/src/syslogflexer.l" +#line 69 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string name = yytext; yylval->build(name); return token::NAME;} YY_BREAK case 11: YY_RULE_SETUP -#line 73 "D:/projects/utillib/src/syslogflexer.l" +#line 73 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN PROCID; yylval->build(" "); return token::SP;} YY_BREAK case 12: YY_RULE_SETUP -#line 77 "D:/projects/utillib/src/syslogflexer.l" +#line 77 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string name = yytext; yylval->build(name); return token::NAME;} YY_BREAK case 13: YY_RULE_SETUP -#line 81 "D:/projects/utillib/src/syslogflexer.l" +#line 81 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN MSGID; yylval->build(" "); return token::SP;} YY_BREAK case 14: YY_RULE_SETUP -#line 85 "D:/projects/utillib/src/syslogflexer.l" +#line 85 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string name = yytext; yylval->build(name); return token::NAME;} YY_BREAK case 15: YY_RULE_SETUP -#line 89 "D:/projects/utillib/src/syslogflexer.l" +#line 89 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN SD; yylval->build(" "); return token::SP;} YY_BREAK case 16: YY_RULE_SETUP -#line 93 "D:/projects/utillib/src/syslogflexer.l" +#line 93 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { return token::NIL;} YY_BREAK case 17: YY_RULE_SETUP -#line 95 "D:/projects/utillib/src/syslogflexer.l" +#line 95 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN MSG; yylval->build(" "); return token::SP;} YY_BREAK case 18: YY_RULE_SETUP -#line 99 "D:/projects/utillib/src/syslogflexer.l" +#line 99 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN SDELEMENT; return '['; } YY_BREAK case 19: YY_RULE_SETUP -#line 102 "D:/projects/utillib/src/syslogflexer.l" +#line 102 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN SD; return ']';} YY_BREAK case 20: YY_RULE_SETUP -#line 105 "D:/projects/utillib/src/syslogflexer.l" +#line 105 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN SDPAR; yylval->build(" "); return token::SP; } YY_BREAK case 21: YY_RULE_SETUP -#line 109 "D:/projects/utillib/src/syslogflexer.l" +#line 109 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string name = yytext; yylval->build(name); return token::NAME; } YY_BREAK case 22: YY_RULE_SETUP -#line 114 "D:/projects/utillib/src/syslogflexer.l" +#line 114 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { return '='; } YY_BREAK case 23: YY_RULE_SETUP -#line 116 "D:/projects/utillib/src/syslogflexer.l" +#line 116 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN SDVALUE; return '\"'; } YY_BREAK case 24: YY_RULE_SETUP -#line 119 "D:/projects/utillib/src/syslogflexer.l" +#line 119 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN SD; return ']';} YY_BREAK case 25: YY_RULE_SETUP -#line 122 "D:/projects/utillib/src/syslogflexer.l" +#line 122 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { yylval->build(" "); return token::SP;} YY_BREAK case 26: YY_RULE_SETUP -#line 125 "D:/projects/utillib/src/syslogflexer.l" +#line 125 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string name = yytext; yylval->build(name); return token::NAME; } YY_BREAK case 27: YY_RULE_SETUP -#line 129 "D:/projects/utillib/src/syslogflexer.l" +#line 129 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { BEGIN SDPAR; return '\"'; } YY_BREAK case 28: YY_RULE_SETUP -#line 132 "D:/projects/utillib/src/syslogflexer.l" +#line 132 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string name = yytext; yylval->build(name); return token::NAME;} @@ -1060,22 +1060,22 @@ YY_RULE_SETUP case 29: /* rule 29 can match eol */ YY_RULE_SETUP -#line 136 "D:/projects/utillib/src/syslogflexer.l" +#line 136 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" { const std::string name = yytext; yylval->build(name); return token::NAME;} YY_BREAK case 30: YY_RULE_SETUP -#line 140 "D:/projects/utillib/src/syslogflexer.l" +#line 140 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" {} YY_BREAK case 31: YY_RULE_SETUP -#line 141 "D:/projects/utillib/src/syslogflexer.l" +#line 141 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" ECHO; YY_BREAK -#line 1078 "D:/projects/utillib/src/syslogflexer.cpp" +#line 1079 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(PRI): case YY_STATE_EOF(VERSION): @@ -2206,7 +2206,7 @@ void yyfree (void * ptr ) /* %ok-for-header */ -#line 141 "D:/projects/utillib/src/syslogflexer.l" +#line 141 "/home/ihedvall/CLionProjects/utillib/src/syslogflexer.l" diff --git a/src/syslogparser.cpp b/src/syslogparser.cpp index 535ac5a..ea754b5 100644 --- a/src/syslogparser.cpp +++ b/src/syslogparser.cpp @@ -42,7 +42,7 @@ // Unqualified %code blocks. -#line 14 "D:/projects/utillib/src/syslogparser.y" +#line 14 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" #include #include "syslogscanner.h" @@ -51,7 +51,7 @@ -#line 55 "D:/projects/utillib/src/syslogparser.cpp" +#line 55 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" #ifndef YY_ @@ -123,9 +123,9 @@ #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus_) -#line 5 "D:/projects/utillib/src/syslogparser.y" +#line 5 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" namespace util { namespace syslog { -#line 129 "D:/projects/utillib/src/syslogparser.cpp" +#line 129 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" /// Build a parser object. SyslogParser::SyslogParser (util::syslog::SyslogScanner &scanner_yyarg) @@ -675,14 +675,14 @@ namespace util { namespace syslog { switch (yyn) { case 2: // syslog_message: pri version "space" isotime "space" hostname "space" appname "space" procid "space" msgid "space" sd msg -#line 36 "D:/projects/utillib/src/syslogparser.y" +#line 36 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { } -#line 682 "D:/projects/utillib/src/syslogparser.cpp" +#line 682 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 3: // pri: '<' "int" '>' -#line 39 "D:/projects/utillib/src/syslogparser.y" +#line 39 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "PRI: " << yystack_[1].value.as < int > () << std::endl; const auto pri = static_cast(yystack_[1].value.as < int > ()); const auto severity = static_cast(pri % 8); @@ -690,92 +690,92 @@ namespace util { namespace syslog { scanner.Severity(severity); scanner.Facility(facility); } -#line 694 "D:/projects/utillib/src/syslogparser.cpp" +#line 694 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 4: // version: %empty -#line 47 "D:/projects/utillib/src/syslogparser.y" +#line 47 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "VERSION: 0" << std::endl; scanner.Version(0); } -#line 702 "D:/projects/utillib/src/syslogparser.cpp" +#line 702 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 5: // version: "int" -#line 50 "D:/projects/utillib/src/syslogparser.y" +#line 50 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "VERSION: " << yystack_[0].value.as < int > () << std::endl; scanner.Version(static_cast(yystack_[0].value.as < int > ())); } -#line 710 "D:/projects/utillib/src/syslogparser.cpp" +#line 710 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 6: // isotime: "isotime" -#line 54 "D:/projects/utillib/src/syslogparser.y" +#line 54 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "ISOTIME: " << yystack_[0].value.as < std::string > () << std::endl; scanner.IsoTime(yystack_[0].value.as < std::string > ()); } -#line 718 "D:/projects/utillib/src/syslogparser.cpp" +#line 718 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 7: // hostname: NAME -#line 58 "D:/projects/utillib/src/syslogparser.y" +#line 58 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "HOSTNAME: " << yystack_[0].value.as < std::string > () << std::endl; scanner.Hostname(yystack_[0].value.as < std::string > ()); } -#line 726 "D:/projects/utillib/src/syslogparser.cpp" +#line 726 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 8: // appname: NAME -#line 62 "D:/projects/utillib/src/syslogparser.y" +#line 62 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "APPNAME: " << yystack_[0].value.as < std::string > () << std::endl; scanner.ApplicationName(yystack_[0].value.as < std::string > ()); } -#line 734 "D:/projects/utillib/src/syslogparser.cpp" +#line 734 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 9: // procid: NAME -#line 66 "D:/projects/utillib/src/syslogparser.y" +#line 66 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "PID: " << yystack_[0].value.as < std::string > () << std::endl; scanner.ProcessId(yystack_[0].value.as < std::string > ()); } -#line 742 "D:/projects/utillib/src/syslogparser.cpp" +#line 742 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 10: // msgid: NAME -#line 70 "D:/projects/utillib/src/syslogparser.y" +#line 70 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "MSG-ID: " << yystack_[0].value.as < std::string > () << std::endl; scanner.MessageId(yystack_[0].value.as < std::string > ()); } -#line 750 "D:/projects/utillib/src/syslogparser.cpp" +#line 750 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 16: // sd_id: NAME -#line 82 "D:/projects/utillib/src/syslogparser.y" +#line 82 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "ID: " << yystack_[0].value.as < std::string > () << std::endl; scanner.AddStructuredData(yystack_[0].value.as < std::string > ()); } -#line 758 "D:/projects/utillib/src/syslogparser.cpp" +#line 758 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 20: // sd_param: NAME '=' '"' NAME '"' -#line 90 "D:/projects/utillib/src/syslogparser.y" +#line 90 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "PAR: " << yystack_[4].value.as < std::string > () << ", VALUE: " << yystack_[1].value.as < std::string > () << std::endl; scanner.AppendParameter(yystack_[4].value.as < std::string > (),yystack_[1].value.as < std::string > ()); } -#line 767 "D:/projects/utillib/src/syslogparser.cpp" +#line 767 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; case 23: // msg_any: NAME -#line 98 "D:/projects/utillib/src/syslogparser.y" +#line 98 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" { if (scanner.debug()) std::cout << "MSG: " << yystack_[0].value.as < std::string > () << std::endl; scanner.Message(yystack_[0].value.as < std::string > ()); } -#line 775 "D:/projects/utillib/src/syslogparser.cpp" +#line 775 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" break; -#line 779 "D:/projects/utillib/src/syslogparser.cpp" +#line 779 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" default: break; @@ -1147,11 +1147,11 @@ namespace util { namespace syslog { return symbol_kind::S_YYUNDEF; } -#line 5 "D:/projects/utillib/src/syslogparser.y" +#line 5 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" } } // util::syslog -#line 1153 "D:/projects/utillib/src/syslogparser.cpp" +#line 1153 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.cpp" -#line 101 "D:/projects/utillib/src/syslogparser.y" +#line 101 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" diff --git a/src/syslogparser.hpp b/src/syslogparser.hpp index 0427748..2a8f573 100644 --- a/src/syslogparser.hpp +++ b/src/syslogparser.hpp @@ -32,7 +32,7 @@ /** - ** \file D:/projects/utillib/src/syslogparser.hpp + ** \file /home/ihedvall/CLionProjects/utillib/src/syslogparser.hpp ** Define the util::syslog::parser class. */ @@ -42,16 +42,16 @@ // especially those whose name start with YY_ or yy_. They are // private implementation details that can be changed or removed. -#ifndef YY_YY_D_PROJECTS_UTILLIB_SRC_SYSLOGPARSER_HPP_INCLUDED -# define YY_YY_D_PROJECTS_UTILLIB_SRC_SYSLOGPARSER_HPP_INCLUDED +#ifndef YY_YY_HOME_IHEDVALL_CLIONPROJECTS_UTILLIB_SRC_SYSLOGPARSER_HPP_INCLUDED +# define YY_YY_HOME_IHEDVALL_CLIONPROJECTS_UTILLIB_SRC_SYSLOGPARSER_HPP_INCLUDED // "%code requires" blocks. -#line 7 "D:/projects/utillib/src/syslogparser.y" +#line 7 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" namespace util::syslog { class SyslogScanner; } -#line 55 "D:/projects/utillib/src/syslogparser.hpp" +#line 55 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.hpp" # include // std::abort @@ -185,9 +185,9 @@ # define YYDEBUG 0 #endif -#line 5 "D:/projects/utillib/src/syslogparser.y" +#line 5 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" namespace util { namespace syslog { -#line 191 "D:/projects/utillib/src/syslogparser.hpp" +#line 191 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.hpp" @@ -1228,11 +1228,11 @@ switch (yykind) }; -#line 5 "D:/projects/utillib/src/syslogparser.y" +#line 5 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.y" } } // util::syslog -#line 1234 "D:/projects/utillib/src/syslogparser.hpp" +#line 1234 "/home/ihedvall/CLionProjects/utillib/src/syslogparser.hpp" -#endif // !YY_YY_D_PROJECTS_UTILLIB_SRC_SYSLOGPARSER_HPP_INCLUDED +#endif // !YY_YY_HOME_IHEDVALL_CLIONPROJECTS_UTILLIB_SRC_SYSLOGPARSER_HPP_INCLUDED diff --git a/src/unithelper.cpp b/src/unithelper.cpp index c5cc18c..d7a7eb9 100644 --- a/src/unithelper.cpp +++ b/src/unithelper.cpp @@ -4,7 +4,7 @@ */ #include "util/unithelper.h" - +#define BOOST_NO_AUTO_PTR #include #include #include