curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: scan-build-11 warnings

From: Patrick Monnerat via curl-library <curl-library_at_cool.haxx.se>
Date: Sat, 8 May 2021 12:34:47 +0200

On 5/8/21 12:14 PM, Daniel Stenberg via curl-library wrote:
> Hi friends!
>
> I ran scan-build-11 against the current git master curl code and it
> generates two warnings that I just cannot understand and at the same
> time I cannot easily silence.
>
> We use scan-build in the CI (travis), but that runs an older version
> that doesn't seem to warn for these issues. No other code analyzer has
> warned on these ones either.
>
> For all I can tell, these are false positives. Can *you* find an
> actual problem and fix?

IMHO, this is not only a false positive, but a scan-build bug.

Mabe you can silent it by rephrasing the code. In example:

if(timespent <= 0)

   timespent = 1;

.

.

.

data->progress.ulspeed = ul / timespent;

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html
Received on 2021-05-08