Merge pull request #225 from VectorCamp/feature/cleanup-compiler-warnings

According to https://buildbot-ci.vectorcamp.gr/#/changes/93

most builds succceded and with no compiler warnings. The build failures were only on x86 and Arm for SIMDe builds: x86 because of a bug in SIMDe emulation of own x86 intrinsics in non-native mode and Arm due to clang, unsure if this is actually a bug in SIMDe or clang itself. All the remaining compiler warnings that were suppressed was because they were not possible to fix for the scope of this project. 

This PR will close #170, code quality improvements however will continue with the integration of #222 or similar static code analyzer to CI and continuous refactoring.
This commit is contained in:
Konstantinos Margaritis
2024-01-20 22:41:00 +02:00
committed by GitHub
17 changed files with 61 additions and 118 deletions

View File

@@ -1299,7 +1299,7 @@ unique_ptr<raw_report_info> gough_build_strat::gatherReports(
*arbReport = MO_INVALID_IDX;
assert(!ri->rl.empty()); /* all components should be able to generate
reports */
return std::move(ri);
return ri;
}
u32 raw_gough_report_info_impl::getReportListSize() const {

View File

@@ -136,7 +136,7 @@ void dumpLimexReachMasks(u32 model_size, const u8 *reach, u32 reachCount,
for (u32 i = 0; i < reachCount; i++) {
char tmp_common[100];
const u8 *row = reach + (i * (model_size/8));
sprintf(tmp_common, "reach mask %u ", i);
snprintf(tmp_common, sizeof(tmp_common), "reach mask %u ", i);
dumpMask(f, tmp_common, row, model_size);
}
}

View File

@@ -462,7 +462,7 @@ unique_ptr<raw_report_info> mcclellan_build_strat::gatherReports(
*isSingleReport = 0;
}
return std::move(ri);
return ri;
}
u32 raw_report_info_impl::getReportListSize() const {
@@ -620,7 +620,7 @@ bytecode_ptr<NFA> mcclellanCompile16(dfa_info &info, const CompileContext &cc,
u8 alphaShift = info.getAlphaShift();
assert(alphaShift <= 8);
u16 count_real_states;
u16 count_real_states{0};
u16 wide_limit;
if (!allocateFSN16(info, &count_real_states, &wide_limit)) {
DEBUG_PRINTF("failed to allocate state numbers, %zu states total\n",

View File

@@ -347,7 +347,6 @@ template<> struct NFATraits<LBR_NFA_VERM16> {
UNUSED static const char *name;
static const NFACategory category = NFA_OTHER;
static const u32 stateAlign = 8;
static const bool fast = true;
static const nfa_dispatch_fn has_accel;
static const nfa_dispatch_fn has_repeats;
static const nfa_dispatch_fn has_repeats_other_than_firsts;
@@ -363,7 +362,6 @@ template<> struct NFATraits<LBR_NFA_NVERM16> {
UNUSED static const char *name;
static const NFACategory category = NFA_OTHER;
static const u32 stateAlign = 8;
static const bool fast = true;
static const nfa_dispatch_fn has_accel;
static const nfa_dispatch_fn has_repeats;
static const nfa_dispatch_fn has_repeats_other_than_firsts;

View File

@@ -270,7 +270,7 @@ unique_ptr<raw_report_info> sheng_build_strat::gatherReports(
*isSingleReport = 0;
}
return std::move(ri);
return ri;
}
u32 sheng_build_strat::max_allowed_offset_accel() const {

View File

@@ -2024,7 +2024,7 @@ unique_ptr<Component> parse(const char *ptr, ParseMode &globalMode) {
// Ensure that all references are valid.
checkReferences(*rootSeq, groupIndex, groupNames);
return std::move(rootSeq);
return rootSeq;
} catch (LocatedParseError &error) {
if (ts >= ptr && ts <= pe) {
error.locate(ts - ptr);

View File

@@ -62,8 +62,6 @@ using boost::adaptors::map_values;
namespace ue2 {
static const size_t MAX_ACCEL_STRING_LEN = 16;
#if defined(DEBUG) || defined(DUMP_SUPPORT)
static UNUSED
string dumpMask(const vector<u8> &v) {

View File

@@ -64,7 +64,7 @@
#define HAVE_SIMD_512_BITS
#endif
#if defined(__AVX512VBMI__) && defined(BUILD_AVX512)
#if defined(__AVX512VBMI__) && defined(BUILD_AVX512VBMI)
#define HAVE_AVX512VBMI
#endif