[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-ddrescue] GNU ddrescue 1.27-rc1 released
From: |
Antonio Diaz Diaz |
Subject: |
Re: [Bug-ddrescue] GNU ddrescue 1.27-rc1 released |
Date: |
Fri, 23 Dec 2022 16:48:08 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 |
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
[-Wimplicit-fallthrough=]
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,
Antonio.