Skip to content

Commit

Permalink
correct nb td warnings (#4821)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Mendelsohn authored and GitHub Enterprise committed Jul 10, 2024
1 parent 954b1dc commit 2859770
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 12 deletions.
3 changes: 1 addition & 2 deletions groups/bal/balb/balb_performancemonitor.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,7 @@ int main(int argc, char *argv[])
"))))", "((((", "!@#$%^&*()",
"()()()()()()()()", "0123456789abcdef",
"((((((((((((((((", "))))))))))))))))",
"very very very very very very very very"
" very very very very long string" };
"very very very very very very very very very very very very long string" };
enum { k_NUM_STRINGS = sizeof strings / sizeof *strings };
enum { k_LONG_STR_IDX = k_NUM_STRINGS - 1 };

Expand Down
6 changes: 4 additions & 2 deletions groups/bal/ball/ball_log.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,8 @@ ResultRec& testSetCategoryHierarchically(const Agg& expectedLevels,
// Note that there will be a separate instance of 'holderA' for every
// distinct value of 'KK'.

static CatHolder holderA = defaultHolder;
static CatHolder holderA =
{ { CatHolder::e_UNINITIALIZED_CATEGORY }, { 0 }, { 0 } };
ASSERTV(pos, repeat || !bsl::memcmp(&holderA,
&defaultHolder,
sizeof(holderA)));
Expand Down Expand Up @@ -1410,7 +1411,8 @@ ResultRec& testSetCategoryHierarchically(const Agg& expectedLevels,
// a different category holder. Like 'holderA', we will get a separate
// copy of 'holderB' for every distinct value of 'KK'.

static CatHolder holderB = defaultHolder;
static CatHolder holderB =
{ { CatHolder::e_UNINITIALIZED_CATEGORY }, { 0 }, { 0 } };
ASSERTV(pos, repeat || !bsl::memcmp(&holderB,
&defaultHolder,
sizeof(holderB)));
Expand Down
2 changes: 1 addition & 1 deletion groups/bal/ball/ball_ruleset.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ int main(int argc, char *argv[])
"R4R5R6",

"R0R1R2R3",
"R0R1R2R3R4"
"R0R1R2R3R4",
"R0R1R2R3R4R5",
"R0R1R2R3R4R5R6",
"R0R1R2R3R4R5R6R7",
Expand Down
2 changes: 1 addition & 1 deletion groups/bal/balst/balst_stacktraceutil.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void testStackTrace(const balst::StackTrace& st, int tolerateMisses = 0)
if (!FORMAT_ELF && !FORMAT_DLADDR && DEBUG_ON && !pastMain) {
ASSERT(frame.lineNumber() > 0);
}
else if (FORMAT_XCOFF && DEBUG_ON) {
else if (FORMAT_XCOFF && !!DEBUG_ON) {
ASSERT(frame.isSourceFileNameKnown());

// There may be one stack frame that had inlined code in it.
Expand Down
11 changes: 8 additions & 3 deletions groups/bal/baltzo/baltzo_localdatetime.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,9 @@ int main(int argc, char *argv[])
if ('N' == MEMDST2 && 'Y' == MEMSRC1) {
ASSERTV(LINE1, LINE2, 0 < EXCEPTION_COUNT);
}
#else
(void)MEMDST2;
(void)MEMSRC1;
#endif
} BSLMA_TESTALLOCATOR_EXCEPTION_TEST_END

Expand Down Expand Up @@ -1123,6 +1126,8 @@ int main(int argc, char *argv[])
if ('Y' == MEM) {
ASSERTV(LINE, 0 < EXCEPTION_COUNT);
}
#else
(void)MEM;
#endif
} BSLMA_TESTALLOCATOR_EXCEPTION_TEST_END

Expand Down Expand Up @@ -2901,7 +2906,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -3939,7 +3944,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(LINE, CONFIG, !"Bad allocator config.");
ASSERTV(LINE, CONFIG, 0 == "Bad allocator config.");
} break;
}
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
Expand Down Expand Up @@ -4246,7 +4251,7 @@ int main(int argc, char *argv[])
objAllocatorPtr = &sa;
} break;
default: {
ASSERTV(CONFIG, !"Bad allocator config.");
ASSERTV(CONFIG, 0 == "Bad allocator config.");
} break;
}

Expand Down
2 changes: 1 addition & 1 deletion groups/bal/baltzo/baltzo_localtimeperiod.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ int main(int argc, char *argv[])
done = true;
} break;
default: {
ASSERTV(CONFIG, !"second switch failed");
ASSERTV(CONFIG, 0 == "second switch failed");
}
}

Expand Down
4 changes: 2 additions & 2 deletions groups/bal/baltzo/baltzo_zoneinfo.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2536,7 +2536,7 @@ int main(int argc, char *argv[])
// Silence "sometimes-uninitialized" warnings.
objPtr = 0;
objAllocatorPtr = 0;
LOOP_ASSERT(CONFIG, !"Bad allocator config.");
LOOP_ASSERT(CONFIG, 0 == "Bad allocator config.");
} break;
}
LOOP2_ASSERT(LINE, CONFIG,
Expand Down Expand Up @@ -4592,7 +4592,7 @@ int main(int argc, char *argv[])
// Silence "sometimes-uninitialized" warnings.
objPtr = 0;
objAllocatorPtr = 0;
LOOP_ASSERT(CONFIG, !"Bad allocator Config.");
LOOP_ASSERT(CONFIG, 0 == "Bad allocator Config.");
} break;
}

Expand Down

0 comments on commit 2859770

Please sign in to comment.