All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: dev@dpdk.org, stable@dpdk.org, dmitry.kozliuk@gmail.com
Subject: Re: [dpdk-dev] [PATCH v2] eal/windows: explicitly cast void * to type *
Date: Sun, 17 Jan 2021 10:10:39 -0800	[thread overview]
Message-ID: <20210117101039.1dcf7201@hermes.local> (raw)
In-Reply-To: <1610739501-21508-1-git-send-email-roretzla@linux.microsoft.com>

On Fri, 15 Jan 2021 11:38:21 -0800
Tyler Retzlaff <roretzla@linux.microsoft.com> wrote:

> Explicitly cast void * to type * so that eal headers may be compiled
> as C or C++.
> 
> Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
>  lib/librte_eal/windows/include/rte_os.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h
> index ea3fe60e5..7ef38ff06 100644
> --- a/lib/librte_eal/windows/include/rte_os.h
> +++ b/lib/librte_eal/windows/include/rte_os.h
> @@ -86,7 +86,7 @@ asprintf(char **buffer, const char *format, ...)
>  		return -1;
>  	size++;
>  
> -	*buffer = malloc(size);
> +	*buffer = (char *)malloc(size);
>  	if (*buffer == NULL)
>  		return -1;
>  

Why is the compiler enforcing C++ rules on code that is inside "extern C {"?

Bigger question is why is this code inlined? It is not critical path
and should be a function.

  parent reply	other threads:[~2021-01-17 18:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12  1:18 [dpdk-dev] [PATCH] eal/headers: explicitly cast void * to type * Tyler Retzlaff
2021-01-13 17:52 ` Dmitry Kozlyuk
2021-01-14  5:45   ` Tyler Retzlaff
2021-01-14  7:05     ` Dmitry Kozlyuk
2021-01-14 10:55       ` Bruce Richardson
2021-01-14 18:27         ` Dmitry Kozlyuk
2021-01-14 18:49           ` Thomas Monjalon
2021-01-15 19:21         ` Tyler Retzlaff
2021-01-17 17:13           ` Thomas Monjalon
2021-01-15 19:38 ` [dpdk-dev] [PATCH v2] eal/windows: " Tyler Retzlaff
2021-01-17 17:19   ` Thomas Monjalon
2021-01-17 18:10   ` Stephen Hemminger [this message]
2021-01-17 19:51     ` Dmitry Kozlyuk

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=20210117101039.1dcf7201@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=stable@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.