From: Olivier MATZ <olivier.matz@6wind.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/7] mempool: fix build with debug enabled
Date: Wed, 04 Mar 2015 10:59:33 +0100 [thread overview]
Message-ID: <54F6D785.3040305@6wind.com> (raw)
In-Reply-To: <1425396230-13379-2-git-send-email-thomas.monjalon@6wind.com>
Hi Thomas,
On 03/03/2015 04:23 PM, Thomas Monjalon wrote:
> error: format ‘%p’ expects argument of type ‘void *’,
> but argument 5 has type ‘const struct rte_mempool *’ [-Werror=format=]
>
> mp type is (const struct rte_mempool *) and must be casted into a simpler
> type to be printed.
I was a bit surprised to see this warning although the standard says:
The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing wide characters, in an
implementation-defined manner.
But I think we often do this in dpdk, without any warning:
struct foo_s *foo = ...;
printf("%p\n", foo);
After some search, the reason why you get a warning here is that you
compile a C file that includes this header with the "-pedantic" flag.
So, I think doing this fix is justified for header files as we cannot
predict which options are used by the user of these headers.
So:
Acked-by: Olivier Matz <olivier.matz@6wind.com>
next prev parent reply other threads:[~2015-03-04 9:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 15:23 [dpdk-dev] [PATCH 0/7] " Thomas Monjalon
2015-03-03 15:23 ` [dpdk-dev] [PATCH 1/7] mempool: " Thomas Monjalon
2015-03-04 9:59 ` Olivier MATZ [this message]
2015-03-03 15:23 ` [dpdk-dev] [PATCH 2/7] fm10k: " Thomas Monjalon
2015-03-03 15:23 ` [dpdk-dev] [PATCH 3/7] virtio: fix build with mempool " Thomas Monjalon
2015-03-04 1:15 ` Ouyang, Changchun
2015-03-03 15:23 ` [dpdk-dev] [PATCH 4/7] virtio: fix build with " Thomas Monjalon
2015-03-04 1:17 ` Ouyang, Changchun
2015-03-03 15:23 ` [dpdk-dev] [PATCH 5/7] mlx4: fix build with mempool " Thomas Monjalon
2015-03-03 16:02 ` Adrien Mazarguil
2015-03-03 15:23 ` [dpdk-dev] [PATCH 6/7] mlx4: mute auto config in quiet mode Thomas Monjalon
2015-03-03 16:03 ` Adrien Mazarguil
2015-03-03 15:23 ` [dpdk-dev] [PATCH 7/7] bond: remove debug function to fix link with shared lib Thomas Monjalon
2015-03-04 9:49 ` Declan Doherty
2015-03-04 10:21 ` [dpdk-dev] [PATCH 0/7] fix build with debug enabled Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F6D785.3040305@6wind.com \
--to=olivier.matz@6wind.com \
--cc=dev@dpdk.org \
--cc=thomas.monjalon@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).