Skip to content

Commit 04c3fcb

Browse files
committed
Unnecessary compiler warning for the cast operation is disabled locally.(MinGW-w64 only)
1 parent cddeaf1 commit 04c3fcb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

portable/MSVC-MingW/port.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,19 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
246246
FALSE, /* Start not signalled. */
247247
NULL ); /* No name. */
248248

249+
250+
#ifdef __x86_64__
251+
/* MinGW-w64 compiler reports the warning for the cast operation from TaskFunction_t to LPTHREAD_START_ROUTINE. */
252+
/* Disable this warning here by the #pragma option. */
253+
#pragma GCC diagnostic push
254+
#pragma GCC diagnostic ignored "-Wcast-function-type"
255+
#endif
249256
/* Create the thread itself. */
250257
pxThreadState->pvThread = CreateThread( NULL, xStackSize, ( LPTHREAD_START_ROUTINE ) pxCode, pvParameters, CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, NULL );
258+
#ifdef __x86_64__
259+
#pragma GCC diagnostic pop
260+
#endif
261+
251262
configASSERT( pxThreadState->pvThread ); /* See comment where TerminateThread() is called. */
252263
SetThreadAffinityMask( pxThreadState->pvThread, 0x01 );
253264
SetThreadPriorityBoost( pxThreadState->pvThread, TRUE );

0 commit comments

Comments
 (0)