Skip to content

Commit 2859770

Browse files
Jeffrey MendelsohnGitHub Enterprise
authored andcommitted
correct nb td warnings (#4821)
1 parent 954b1dc commit 2859770

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

groups/bal/balb/balb_performancemonitor.t.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,7 @@ int main(int argc, char *argv[])
800800
"))))", "((((", "!@#$%^&*()",
801801
"()()()()()()()()", "0123456789abcdef",
802802
"((((((((((((((((", "))))))))))))))))",
803-
"very very very very very very very very"
804-
" very very very very long string" };
803+
"very very very very very very very very very very very very long string" };
805804
enum { k_NUM_STRINGS = sizeof strings / sizeof *strings };
806805
enum { k_LONG_STR_IDX = k_NUM_STRINGS - 1 };
807806

groups/bal/ball/ball_log.t.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,8 @@ ResultRec& testSetCategoryHierarchically(const Agg& expectedLevels,
13501350
// Note that there will be a separate instance of 'holderA' for every
13511351
// distinct value of 'KK'.
13521352

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

1413-
static CatHolder holderB = defaultHolder;
1414+
static CatHolder holderB =
1415+
{ { CatHolder::e_UNINITIALIZED_CATEGORY }, { 0 }, { 0 } };
14141416
ASSERTV(pos, repeat || !bsl::memcmp(&holderB,
14151417
&defaultHolder,
14161418
sizeof(holderB)));

groups/bal/ball/ball_ruleset.t.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ int main(int argc, char *argv[])
728728
"R4R5R6",
729729

730730
"R0R1R2R3",
731-
"R0R1R2R3R4"
731+
"R0R1R2R3R4",
732732
"R0R1R2R3R4R5",
733733
"R0R1R2R3R4R5R6",
734734
"R0R1R2R3R4R5R6R7",

groups/bal/balst/balst_stacktraceutil.t.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ void testStackTrace(const balst::StackTrace& st, int tolerateMisses = 0)
446446
if (!FORMAT_ELF && !FORMAT_DLADDR && DEBUG_ON && !pastMain) {
447447
ASSERT(frame.lineNumber() > 0);
448448
}
449-
else if (FORMAT_XCOFF && DEBUG_ON) {
449+
else if (FORMAT_XCOFF && !!DEBUG_ON) {
450450
ASSERT(frame.isSourceFileNameKnown());
451451

452452
// There may be one stack frame that had inlined code in it.

groups/bal/baltzo/baltzo_localdatetime.t.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,9 @@ int main(int argc, char *argv[])
685685
if ('N' == MEMDST2 && 'Y' == MEMSRC1) {
686686
ASSERTV(LINE1, LINE2, 0 < EXCEPTION_COUNT);
687687
}
688+
#else
689+
(void)MEMDST2;
690+
(void)MEMSRC1;
688691
#endif
689692
} BSLMA_TESTALLOCATOR_EXCEPTION_TEST_END
690693

@@ -1123,6 +1126,8 @@ int main(int argc, char *argv[])
11231126
if ('Y' == MEM) {
11241127
ASSERTV(LINE, 0 < EXCEPTION_COUNT);
11251128
}
1129+
#else
1130+
(void)MEM;
11261131
#endif
11271132
} BSLMA_TESTALLOCATOR_EXCEPTION_TEST_END
11281133

@@ -2901,7 +2906,7 @@ int main(int argc, char *argv[])
29012906
objAllocatorPtr = &sa;
29022907
} break;
29032908
default: {
2904-
ASSERTV(CONFIG, !"Bad allocator config.");
2909+
ASSERTV(CONFIG, 0 == "Bad allocator config.");
29052910
} break;
29062911
}
29072912
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
@@ -3939,7 +3944,7 @@ int main(int argc, char *argv[])
39393944
objAllocatorPtr = &sa;
39403945
} break;
39413946
default: {
3942-
ASSERTV(LINE, CONFIG, !"Bad allocator config.");
3947+
ASSERTV(LINE, CONFIG, 0 == "Bad allocator config.");
39433948
} break;
39443949
}
39453950
ASSERTV(LINE, CONFIG, sizeof(Obj) == fa.numBytesInUse());
@@ -4246,7 +4251,7 @@ int main(int argc, char *argv[])
42464251
objAllocatorPtr = &sa;
42474252
} break;
42484253
default: {
4249-
ASSERTV(CONFIG, !"Bad allocator config.");
4254+
ASSERTV(CONFIG, 0 == "Bad allocator config.");
42504255
} break;
42514256
}
42524257

groups/bal/baltzo/baltzo_localtimeperiod.t.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ int main(int argc, char *argv[])
11851185
done = true;
11861186
} break;
11871187
default: {
1188-
ASSERTV(CONFIG, !"second switch failed");
1188+
ASSERTV(CONFIG, 0 == "second switch failed");
11891189
}
11901190
}
11911191

groups/bal/baltzo/baltzo_zoneinfo.t.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,7 @@ int main(int argc, char *argv[])
25362536
// Silence "sometimes-uninitialized" warnings.
25372537
objPtr = 0;
25382538
objAllocatorPtr = 0;
2539-
LOOP_ASSERT(CONFIG, !"Bad allocator config.");
2539+
LOOP_ASSERT(CONFIG, 0 == "Bad allocator config.");
25402540
} break;
25412541
}
25422542
LOOP2_ASSERT(LINE, CONFIG,
@@ -4592,7 +4592,7 @@ int main(int argc, char *argv[])
45924592
// Silence "sometimes-uninitialized" warnings.
45934593
objPtr = 0;
45944594
objAllocatorPtr = 0;
4595-
LOOP_ASSERT(CONFIG, !"Bad allocator Config.");
4595+
LOOP_ASSERT(CONFIG, 0 == "Bad allocator Config.");
45964596
} break;
45974597
}
45984598

0 commit comments

Comments
 (0)