DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] net/memif: fix build error with gcc 9.1
@ 2019-08-07  3:11 jerinj
  2019-08-07  8:28 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: jerinj @ 2019-08-07  3:11 UTC (permalink / raw)
  To: dev, Jakub Grajciar; +Cc: thomas, Jerin Jacob

From: Jerin Jacob <jerinj@marvell.com>

gcc-9 stricter on NULL arguments for printf.
Fix the following build error by avoiding NULL argument to printf.

In file included from drivers/net/memif/memif_socket.c:26:
In function 'memif_socket_create',
inlined from 'memif_socket_init' at net/memif/memif_socket.c:965:12:
net/memif/rte_eth_memif.h:35:2: error: '%s' directive argument is null
[-Werror=format-overflow=]
   35 |  rte_log(RTE_LOG_ ## level, memif_logtype, \
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |   "%s(): " fmt "\n", __func__, ##args)
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/memif/memif_socket.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 137033f68..6740e3471 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -918,7 +918,8 @@ memif_socket_create(struct pmd_internals *pmd, char *key, uint8_t listener)
 
  error:
 	MIF_LOG(ERR, "%s: Failed to setup socket %s: %s",
-		rte_vdev_device_name(pmd->vdev), key, strerror(errno));
+		rte_vdev_device_name(pmd->vdev) ?
+		rte_vdev_device_name(pmd->vdev) : "NULL", key, strerror(errno));
 	if (sock != NULL)
 		rte_free(sock);
 	if (sockfd >= 0)
-- 
2.22.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/memif: fix build error with gcc 9.1
  2019-08-07  3:11 [dpdk-dev] [PATCH] net/memif: fix build error with gcc 9.1 jerinj
@ 2019-08-07  8:28 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2019-08-07  8:28 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Jakub Grajciar

07/08/2019 05:11, jerinj@marvell.com:
> From: Jerin Jacob <jerinj@marvell.com>
> 
> gcc-9 stricter on NULL arguments for printf.
> Fix the following build error by avoiding NULL argument to printf.
> 
> In file included from drivers/net/memif/memif_socket.c:26:
> In function 'memif_socket_create',
> inlined from 'memif_socket_init' at net/memif/memif_socket.c:965:12:
> net/memif/rte_eth_memif.h:35:2: error: '%s' directive argument is null
> [-Werror=format-overflow=]
>    35 |  rte_log(RTE_LOG_ ## level, memif_logtype, \
>       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    36 |   "%s(): " fmt "\n", __func__, ##args)
>       |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")
> 
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>

Applied, thanks




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-07  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07  3:11 [dpdk-dev] [PATCH] net/memif: fix build error with gcc 9.1 jerinj
2019-08-07  8:28 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).