Skip to content

Commit cb85579

Browse files
committed
Modify the condition for ignoring compiler warning for the cast operation.
Before modification: Compiler warning was ignored only on MinGW64 After modification: Compiler warning is ignored on MinGW32 and MinGW64 Reason of modification: The cast warning here is unavoidable not only on MinGW64 but also on MinGW32. "__GNUC__" macro is used because MSVC does not recognize this #pragma directive.
1 parent 04c3fcb commit cb85579

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

portable/MSVC-MingW/port.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,15 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
247247
NULL ); /* No name. */
248248

249249

250-
#ifdef __x86_64__
251-
/* MinGW-w64 compiler reports the warning for the cast operation from TaskFunction_t to LPTHREAD_START_ROUTINE. */
250+
#ifdef __GNUC__
251+
/* GCC reports the warning for the cast operation from TaskFunction_t to LPTHREAD_START_ROUTINE. */
252252
/* Disable this warning here by the #pragma option. */
253253
#pragma GCC diagnostic push
254254
#pragma GCC diagnostic ignored "-Wcast-function-type"
255255
#endif
256256
/* Create the thread itself. */
257257
pxThreadState->pvThread = CreateThread( NULL, xStackSize, ( LPTHREAD_START_ROUTINE ) pxCode, pvParameters, CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, NULL );
258-
#ifdef __x86_64__
258+
#ifdef __GNUC__
259259
#pragma GCC diagnostic pop
260260
#endif
261261

0 commit comments

Comments
 (0)