]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme: fix compiler warnings
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Fri, 24 Apr 2020 01:14:53 +0000 (18:14 -0700)
committerKeith Busch <kbusch@kernel.org>
Fri, 24 Apr 2020 14:42:24 +0000 (23:42 +0900)
commita032a481d7406c5a0ae188eeaae709805d1c6e02
treec65774ff7415bbdcad1993a9c66d55d83d95a032
parentf51db5855593b84a79cd9f48322e702fe0be8bb7
nvme: fix compiler warnings

This patch fixes the following errors :-

nvme-topology.c: In function ‘verify_legacy_ns’:
nvme-topology.c:361:32: error: format not a string literal and no format arguments [-Werror=format-security]
  361 |    asprintf(&n->ctrl->address, tmp_address);
      |                                ^~~~~~~~~~~
nvme-topology.c:360:4: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
  360 |    asprintf(&n->ctrl->transport, "pcie");
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvme-topology.c:361:4: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
  361 |    asprintf(&n->ctrl->address, tmp_address);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:96: nvme-topology.o] Error 1

This can be easily re produced on the gcc version :-
(Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
nvme-topology.c