dd59061711dca60f7fe8f430411b8c5eb7559d4a braney Fri Jun 12 14:48:21 2026 -0700 lib/tests: fix -O3 format-overflow in mmHashTest Put the fprintf in the else of the NULL guard so -Wformat-overflow (which runs before the noreturn-based pruning) sees the value is non-null. Same pattern as the earlier sanger22gtf/bottleneck fixes. This surfaced only now because make clean does not clean most test directories, so the test programs kept reusing stale -O -g objects until a forced rebuild recompiled them at -O3. refs #37761 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> diff --git src/lib/tests/mmHashTest.c src/lib/tests/mmHashTest.c index f0654ebf1ee..7fa06ab5400 100644 --- src/lib/tests/mmHashTest.c +++ src/lib/tests/mmHashTest.c @@ -76,30 +76,31 @@ char longRandomString[512]; makeRandomString(longRandomString, sizeof longRandomString); const char *shouldBeNull = mmHashFindVal(mmh, longRandomString); if (shouldBeNull != NULL) errAbort("Error: I really did not expect to find the following line as a key in %s:\n%s\n" "-- but there it was, with a value of '%s'", inFileName, longRandomString, shouldBeNull); // Look up and write out all the items. struct slName *key; for (key = keyList; key != NULL; key = key->next) { const char *val = mmHashFindVal(mmh, key->name); if (val == NULL) errAbort("Lookup of key '%s' failed.", key->name); + else fprintf(f, "%s\t%s\n", key->name, val); } carefulClose(&f); } int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, options); if (argc != 4) usage(); mmHashTest(argv[1], argv[2], argv[3]); return 0; }