Open Bogdan107 opened 3 years ago
In my local lab, also see these errors on mipsisa64r6el. The compile environment is QEMU-user-based Arch Linux (MIPS R6) Docker image, docker version is 20.10.12, gcc version 12.1.1 20220730 (GCC).
Total 4 errors:
/opt/jenkins_home/workspace/ciBuilds_clucene/clucene/src/core/CLucene/queryParser/QueryParserTokenManager.cpp:18:76: error: narrowing conversion of ‘18446744073709551615’ from ‘long long unsigned int’ to ‘int64_t’ {aka ‘long int’} [-Wnarrowing]
12:27:06 18 | const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)};
/opt/jenkins_home/workspace/ciBuilds_clucene/clucene/src/core/CLucene/queryParser/QueryParser.cpp:82:176: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int32_t’ {aka ‘int’} [-Wnarrowing]
12:27:09 82 | const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000};
in addition to the two mentioned above, there are two more:
/opt/jenkins_home/workspace/ciBuilds_clucene/clucene/src/core/CLucene/analysis/standard/StandardTokenizer.cpp:192:24: error: cannot convert ‘bool’ to ‘lucene::analysis::Token*’ in return
12:27:10 192 | return false;
12:27:10 | ^~~~~
/opt/jenkins_home/workspace/ciBuilds_clucene/clucene/src/core/CLucene/analysis/standard/StandardTokenizer.cpp:192:24: error: cannot convert ‘bool’ to ‘lucene::analysis::Token*’ in return
12:27:10 192 | return false;
12:27:10 | ^~~~~
/home/jenkins/clucene/src/core/CLucene/document/DateTools.cpp:188:8: error: invalid use of incomplete type 'struct tm'
188 | ptm->tm_min = 59;
| ^~
and when i fixed it with the following patch, can make sucessful.
fix error 1: changed to uint64_t
fix error 2: changed to int64_t
fix error 3: changed to NULL
fix error 4: add header file #include
diff --git a/src/core/CLucene/analysis/standard/StandardTokenizer.cpp b/src/core/CLucene/analysis/standard/StandardTokenizer.cpp
index 3fe61ba..903819a 100644
--- a/src/core/CLucene/analysis/standard/StandardTokenizer.cpp
+++ b/src/core/CLucene/analysis/standard/StandardTokenizer.cpp
@@ -189,7 +189,7 @@ CL_NS_DEF2(analysis,standard)
//if a number is too long, i would say there is no point
//storing it, because its going to be the wrong number anyway?
//what do people think?
- return false;
+ return NULL;
}
str.appendChar(prev);
@@ -221,7 +221,7 @@ CL_NS_DEF2(analysis,standard)
if (!EOS) {
if (DECIMAL) {
if ( str.len >= LUCENE_MAX_WORD_LEN )
- return false; //read above for rationale
+ return NULL; //read above for rationale
str.appendChar(ch);
} else {
unReadChar();
@@ -250,7 +250,7 @@ CL_NS_DEF2(analysis,standard)
/* If all we have left is a negative sign, it's not a valid number. */
if (rightmost == '-') {
CND_PRECONDITION (str.len == 1, "Number is invalid");
- return false;
+ return NULL;
}
return setToken(t,&str,tokenType);
diff --git a/src/core/CLucene/document/DateTools.cpp b/src/core/CLucene/document/DateTools.cpp
index 06c2e95..0f8005b 100644
--- a/src/core/CLucene/document/DateTools.cpp
+++ b/src/core/CLucene/document/DateTools.cpp
@@ -6,6 +6,7 @@
------------------------------------------------------------------------------*/
#include "CLucene/_ApiHeader.h"
+#include <time.h>
#include "DateTools.h"
#include "CLucene/util/Misc.h"
diff --git a/src/core/CLucene/queryParser/QueryParser.cpp b/src/core/CLucene/queryParser/QueryParser.cpp
index d0986c9..9ec670e 100644
--- a/src/core/CLucene/queryParser/QueryParser.cpp
+++ b/src/core/CLucene/queryParser/QueryParser.cpp
@@ -79,8 +79,8 @@ const TCHAR* QueryParserConstants::tokenImage[] = {
_T("<RANGEEX_GOOP>")
};
-const int32_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000};
-const int32_t QueryParser::jj_la1_1[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0};
+const int64_t QueryParser::jj_la1_0[] = {0x180,0x180,0xe00,0xe00,0x1f69f80,0x48000,0x10000,0x1f69000,0x1348000,0x80000,0x80000,0x10000,0x18000000,0x2000000,0x18000000,0x10000,0x80000000,0x20000000,0x80000000,0x10000,0x80000,0x10000,0x1f68000};
+const int64_t QueryParser::jj_la1_1[] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0};
struct QueryParser::JJCalls {
public:
diff --git a/src/core/CLucene/queryParser/QueryParser.h b/src/core/CLucene/queryParser/QueryParser.h
index 3ca5c55..064ffe4 100644
--- a/src/core/CLucene/queryParser/QueryParser.h
+++ b/src/core/CLucene/queryParser/QueryParser.h
@@ -477,8 +477,8 @@ private:
bool jj_semLA;
int32_t jj_gen;
int32_t jj_la1[23];
- static const int32_t jj_la1_0[];
- static const int32_t jj_la1_1[];
+ static const int64_t jj_la1_0[];
+ static const int64_t jj_la1_1[];
JJCalls* jj_2_rtns;
bool jj_rescan;
int32_t jj_gc;
diff --git a/src/core/CLucene/queryParser/QueryParserTokenManager.cpp b/src/core/CLucene/queryParser/QueryParserTokenManager.cpp
index fead9b0..10e2038 100644
--- a/src/core/CLucene/queryParser/QueryParserTokenManager.cpp
+++ b/src/core/CLucene/queryParser/QueryParserTokenManager.cpp
@@ -15,8 +15,8 @@
CL_NS_DEF(queryParser)
-const int64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)};
-const int64_t QueryParserTokenManager::jjbitVec0[] = {
+const uint64_t QueryParserTokenManager::jjbitVec2[]={0x0L, 0x0L, _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)};
+const uint64_t QueryParserTokenManager::jjbitVec0[] = {
_ILONGLONG(0xfffffffffffffffe), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff), _ILONGLONG(0xffffffffffffffff)
};
const int32_t QueryParserTokenManager::jjnextStates[]={
diff --git a/src/core/CLucene/queryParser/QueryParserTokenManager.h b/src/core/CLucene/queryParser/QueryParserTokenManager.h
index 834c324..8e5c7dc 100644
--- a/src/core/CLucene/queryParser/QueryParserTokenManager.h
+++ b/src/core/CLucene/queryParser/QueryParserTokenManager.h
@@ -35,8 +35,8 @@ private:
void jjCheckNAddStates(int32_t start, const int32_t end);
void jjCheckNAddStates(const int32_t start);
- static const int64_t jjbitVec0[];
- static const int64_t jjbitVec2[];
+ static const uint64_t jjbitVec0[];
+ static const uint64_t jjbitVec2[];
int32_t jjMoveNfa_3(const int32_t startState, int32_t curPos);
Compilation with gcc - SUCCESS.
emerge --info clucene
cat build.log
Error messages: