3e922f07e4d8c51a3b989e3dc6748e33f8516e3b braney Mon Jun 22 09:10:05 2026 -0700 Document two -O3 cleanup details raised in v500 code review Follow-up to code review #37767, addressing two points on commit f57fc11d951: - The else guards in sanger22gtf.c and bottleneck.c looked like leftovers from before errAbort was marked noreturn, but they are still required: removing either one reintroduces -Werror=format-overflow at -O3, because that warning runs before the noreturn-based dead-path pruning. Added a comment at each else saying so. - makeGrayShades (hgGene/altSplice.c and hgTracks/simpleTracks.c) writes shadesOfGray[maxShade+1] = MG_RED as an overflow sentinel. Spelled this out in both function descriptions so the maxShade+2 array sizing is documented at the function, not just at the caller. Comment-only; no behavior change. refs #37767 refs #37761 diff --git src/hg/makeDb/outside/sanger22gtf/sanger22gtf.c src/hg/makeDb/outside/sanger22gtf/sanger22gtf.c index a44916edee1..5a4af9d303d 100644 --- src/hg/makeDb/outside/sanger22gtf/sanger22gtf.c +++ src/hg/makeDb/outside/sanger22gtf/sanger22gtf.c @@ -29,31 +29,31 @@ while (lineFileNext(lf, &line, NULL)) { /* Just pass through comments and blank lines. */ s = skipLeadingSpaces(line); if (s[0] == '#' || s[0] == '0') { fprintf(f, "%s\n", line); continue; } for (i=0; i<8; ++i) { word = nextWord(&line); if (word == NULL) errAbort("Expecting at least 8 words line %d of %s", lf->lineIx, lf->fileName); - else + else // guard printf: -Wformat-overflow runs before errAbort's noreturn prunes the null path fprintf(f, "%s\t", word); } s = skipLeadingSpaces(line); if (s[0] != 0) fprintf(f, "%s", line); fputc('\n', f); } } int main(int argc, char *argv[]) /* Process command line. */ { cgiSpoof(&argc, argv); if (argc != 3)