Hi Christian,

Christian Franke wrote:
Cygwin g++ 11.3.0 prints two warnings which make sense:

Thank you very much for reporting these.

loggers.cc:42:19: note: 'snprintf' output between 15 and 33 bytes into a 
destination of size 32
   42 |   if( d ) snprintf( buf, sizeof buf, "%lldd:%02dh:%02dm:%02ds", d, h, 
m, s );

With normal output, a time interval in the form 10d:10h:10m:10s, there is no way for snprintf to produce more than 19 bytes in the whole life of a computer. But the best thing is that I want the output truncated to 32 bytes when, because of some bug, the interval is wrongly set to LLONG_MIN or something. This is why I'm using snprintf instead of, say, sprintf.

I have "fixed" it as you suggest, by increasing the size of buf, to shut up GCC, but I think this warning should be only enabled with --annoyingly-pedantic or something. ;-)

main.cc:186:17: warning: this statement may fall through
   186 |       case ',': if( comma ) break;

I have "fixed" this one by addind a '// fall through' comment because that is what I have in other projects, like ed or zutils, and it seems to work.

Best regards and happy holidays,

Reply via email to