-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-32395 Clean up compile warnings from jhtree and roxiemem #18959
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32395 Jirabot Action Result: |
@@ -8243,7 +8240,7 @@ class RoxieMemTests : public CppUnit::TestFixture | |||
} | |||
void * otherrow = rowManager->allocate(100, 0); | |||
savedRowHeap.setown(rowManager->createFixedRowHeap(8, ACTIVITY_FLAG_ISREGISTERED|0, RHFhasdestructor|RHFunique)); | |||
void * leakedRow = savedRowHeap->allocate(); | |||
[[maybe_unused]] void * leakedRow = savedRowHeap->allocate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the following be better?
void * leakedRow [[maybe_unused]] = savedRowHeap->allocate();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, slightly. I assume they behave the same?
system/jhtree/jhinplace.cpp
Outdated
@@ -269,6 +269,7 @@ inline void skipPacked(const byte * & cur) | |||
|
|||
//----- special packed format - code is untested | |||
|
|||
#ifdef ALTERNATIVE_PACKING_FORMAT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently unused, and generates warnings about unused static functions. Should possibly delete instead.
system/lzma/LzmaEnc.cpp
Outdated
@@ -1923,7 +1923,7 @@ static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize | |||
static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) | |||
{ | |||
UInt32 beforeSize = kNumOpts; | |||
Bool btMode; | |||
Bool btMode [[maybe_unused]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively I could move this into the #ifdef on line 1930. Would probably be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better as
#ifdef COMPRESS_MF_MT
Bool btMode;
btMode = (p->matchFinderBase.btMode != 0);
p->mtMode = (p->multiThread && !p->fastMode && btMode);
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some places where the warnings are effectively revealing dead code, and it would seem prudent to kill that dead code rather than just killing enough to suppress the warning (and thus make the dead code even less obvious)
@@ -8243,7 +8240,7 @@ class RoxieMemTests : public CppUnit::TestFixture | |||
} | |||
void * otherrow = rowManager->allocate(100, 0); | |||
savedRowHeap.setown(rowManager->createFixedRowHeap(8, ACTIVITY_FLAG_ISREGISTERED|0, RHFhasdestructor|RHFunique)); | |||
void * leakedRow = savedRowHeap->allocate(); | |||
[[maybe_unused]] void * leakedRow = savedRowHeap->allocate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, slightly. I assume they behave the same?
system/jhtree/keybuild.cpp
Outdated
@@ -278,7 +278,7 @@ class CKeyBuilder : public CInterfaceOf<IKeyBuilder> | |||
|
|||
offset_t nextLevel() | |||
{ | |||
offset_t ret = endLevel(false); | |||
endLevel(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the return value supposed to be? Should we be returning ret?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endLevel() function seems completely redundant, and nextLevel a bit pointless... if nextLevel always returns 0 then there's also some redundant code in buildTree.
Feels like this may be supporting some very long-deleted functionality
system/lzma/LzmaEnc.cpp
Outdated
@@ -1923,7 +1923,7 @@ static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize | |||
static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) | |||
{ | |||
UInt32 beforeSize = kNumOpts; | |||
Bool btMode; | |||
Bool btMode [[maybe_unused]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better as
#ifdef COMPRESS_MF_MT
Bool btMode;
btMode = (p->matchFinderBase.btMode != 0);
p->mtMode = (p->multiThread && !p->fastMode && btMode);
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghalliday - a few additional comments
system/lzma/LzmaEnc.cpp
Outdated
@@ -1923,7 +1923,7 @@ static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize | |||
static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) | |||
{ | |||
UInt32 beforeSize = kNumOpts; | |||
Bool btMode; | |||
Bool btMode [[maybe_unused]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
plugins/timelib/timelib.cpp
Outdated
@@ -796,7 +796,7 @@ TIMELIB_API unsigned int TIMELIB_CALL tlAdjustCalendar(unsigned int date, short | |||
unsigned int month = (date - (year * 10000)) / 100; | |||
unsigned int day = date - (year * 10000) - (month * 100); | |||
int expectedMonthVal = month - 1; | |||
time_t seconds; | |||
time_t seconds [[maybe_unused]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this should be removed along with the assignment on line 826..
5f45a4b
to
c38eca9
Compare
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32395 Jirabot Action Result: |
c38eca9
to
6c13b25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look fine although there may be some overlap and/or clashes with PRs of mine that have already been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghalliday - looks good to me.
Signed-off-by: Gavin Halliday <[email protected]>
6c13b25
to
7992afd
Compare
Type of change:
Checklist:
Smoketest:
Testing: