+5
−1
Loading
Scanbuild:
app.c:207:8: warning: File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior [unix.Stream]
207 | rc = fscanf(f, "cpu%li %li %*i %li %*i %*i %li %li %*i %*i %*i\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208 | &cpu, user, sys, irq, &soft_irq);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app.c:207:8: warning: Read function called when stream is in EOF state. Function has no effect [unix.Stream]
207 | rc = fscanf(f, "cpu%li %li %*i %li %*i %*i %li %li %*i %*i %*i\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208 | &cpu, user, sys, irq, &soft_irq);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app.c:220:7: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [core.uninitialized.Assign]
220 | *irq += soft_irq;
| ~~~~ ^
Change-Id: I545675093bcfac241114c1b55f8835fcda3ffd99
Signed-off-by:
Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26865
Tested-by:
SPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by:
Jim Harris <jim.harris@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by:
Jacek Kalwas <jacek.kalwas@nutanix.com>