DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Tal Shnaiderman <talshn@nvidia.com>,
	stable@dpdk.org, Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Dmitry Malloy <dmitrym@microsoft.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>,
	Narcisa Vasile
	<"navasile@linux.microsoft.comnavasile"@microsoft.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Keith Wiles <keith.wiles@intel.com>
Subject: [PATCH 1/3] eal/windows: fix pedantic build
Date: Thu,  5 Jan 2023 17:10:18 +0100	[thread overview]
Message-ID: <20230105161020.247780-2-thomas@monjalon.net> (raw)
In-Reply-To: <20230105161020.247780-1-thomas@monjalon.net>

MinGW GCC 12 shows an illegal pointer conversion
when included in a pedantic module:

lib/eal/windows/include/pthread.h:137:41: error:
	ISO C forbids conversion of object pointer to function pointer type
	[-Werror=pedantic]
 137 | hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
     |                                 ^

Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros")
Cc: stable@dpdk.org

By using uintptr_t, the compiler is forced to accept the conversion.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 lib/eal/windows/include/pthread.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/eal/windows/include/pthread.h b/lib/eal/windows/include/pthread.h
index 27fd2cca52..f7cf0e9ddf 100644
--- a/lib/eal/windows/include/pthread.h
+++ b/lib/eal/windows/include/pthread.h
@@ -134,7 +134,8 @@ pthread_create(void *threadid, const void *threadattr, void *threadfunc,
 {
 	RTE_SET_USED(threadattr);
 	HANDLE hThread;
-	hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc,
+	hThread = CreateThread(NULL, 0,
+		(LPTHREAD_START_ROUTINE)(uintptr_t)threadfunc,
 		args, 0, (LPDWORD)threadid);
 	if (hThread) {
 		SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
-- 
2.39.0


  reply	other threads:[~2023-01-05 16:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 16:10 [PATCH 0/3] fix mlx5 build with MinGW Thomas Monjalon
2023-01-05 16:10 ` Thomas Monjalon [this message]
2023-01-05 16:40   ` [PATCH 1/3] eal/windows: fix pedantic build Tyler Retzlaff
2023-01-05 16:10 ` [PATCH 2/3] common/mlx5: get Windows dependency from standard variables Thomas Monjalon
2023-01-05 16:10 ` [PATCH 3/3] net/mlx5: fix Windows build with MinGW GCC 12 Thomas Monjalon
2023-01-12 20:37 ` [PATCH v2 0/4] fix Windows build with MinGW and mlx5 Thomas Monjalon
2023-01-12 20:37   ` [PATCH v2 1/4] eal/windows: fix pedantic build Thomas Monjalon
2023-03-01 16:33     ` Thomas Monjalon
2023-01-12 20:37   ` [PATCH v2 2/4] common/mlx5: get Windows dependency from standard variables Thomas Monjalon
2023-01-12 20:37   ` [PATCH v2 3/4] net/mlx5: remove weak stub functions Thomas Monjalon
2023-01-23 19:42     ` Dmitry Kozlyuk
2023-01-24 14:42       ` Thomas Monjalon
2023-01-12 20:37   ` [PATCH v2 4/4] net/mlx5: fix Windows build with MinGW GCC 12 Thomas Monjalon
2023-03-02 13:21 ` [PATCH v3 0/3] mlx5: fix Windows build with Linux MinGW Thomas Monjalon
2023-03-02 13:21   ` [PATCH v3 1/3] common/mlx5: get Windows dependency from standard variables Thomas Monjalon
2023-03-02 17:17     ` Tyler Retzlaff
2023-03-03 14:12       ` Thomas Monjalon
2023-03-03 21:09         ` Tyler Retzlaff
2023-03-06  8:30           ` Thomas Monjalon
2023-03-06 20:55             ` Tyler Retzlaff
2023-03-08 10:24     ` Tal Shnaiderman
2023-03-02 13:21   ` [PATCH v3 2/3] net/mlx5: remove weak stub functions Thomas Monjalon
2023-03-02 17:19     ` Tyler Retzlaff
2023-03-08 10:26       ` Tal Shnaiderman
2023-03-02 13:21   ` [PATCH v3 3/3] net/mlx5: fix Windows build with MinGW GCC 12 Thomas Monjalon
2023-03-02 17:28     ` Tyler Retzlaff
2023-03-08 10:27       ` Tal Shnaiderman
2023-03-12 15:44   ` [PATCH v3 0/3] mlx5: fix Windows build with Linux MinGW Raslan Darawsheh

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=20230105161020.247780-2-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc="navasile@linux.microsoft.comnavasile"@microsoft.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=dmitrym@microsoft.com \
    --cc=keith.wiles@intel.com \
    --cc=navasile@linux.microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=stable@dpdk.org \
    --cc=talshn@nvidia.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).