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/weblet/bottleneck/bottleneck.c src/weblet/bottleneck/bottleneck.c index b1b89cdbce3..102269e352c 100644 --- src/weblet/bottleneck/bottleneck.c +++ src/weblet/bottleneck/bottleneck.c @@ -221,31 +221,31 @@ void queryServer(char *ip, int count, double fraction) /* Query bottleneck server - just for testing. * Main query is over ip port. */ { int i; char sendString[256]; safef(sendString, sizeof(sendString), "%s %f", ip, fraction); for (i=0; i<count; ++i) { int socket = netMustConnect(host, port); char buf[256], *s; netSendString(socket, sendString); s = netGetString(socket, buf); if (s == NULL) errAbort("Shut out by bottleneck server %s:%d", host, port); - else + else // guard printf: -Wformat-overflow runs before errAbort's noreturn prunes the null path printf("%s millisecond delay recommended\n", s); close(socket); } } void setUser(char *ip, char *millis) /* Set user current delay. */ { int socket = netMustConnect(host, port); char buf[256]; safef(buf, sizeof(buf), "?set %s %s", ip, millis); netSendString(socket, buf); close(socket); }