@@ -583,8 +583,11 @@ SWIFT_CC(swiftasync)
583
583
static void task_wait_throwing_resume_adapter(SWIFT_ASYNC_CONTEXT AsyncContext *_context) {
584
584
585
585
auto context = static_cast <TaskFutureWaitAsyncContext *>(_context);
586
+ #pragma clang diagnostic push
587
+ #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
586
588
auto resumeWithError =
587
589
reinterpret_cast <AsyncVoidClosureEntryPoint *>(context->ResumeParent );
590
+ #pragma clang diagnostic pop
588
591
return resumeWithError (context->Parent , context->errorResult );
589
592
}
590
593
@@ -959,17 +962,23 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
959
962
auto asyncContextPrefix = reinterpret_cast <AsyncContextPrefix *>(
960
963
reinterpret_cast <char *>(allocation) + headerSize -
961
964
sizeof (AsyncContextPrefix));
965
+ #pragma clang diagnostic push
966
+ #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
962
967
asyncContextPrefix->asyncEntryPoint =
963
968
reinterpret_cast <AsyncVoidClosureEntryPoint *>(function);
969
+ #pragma clang diagnostic pop
964
970
asyncContextPrefix->closureContext = closureContext;
965
971
function = non_future_adapter;
966
972
assert (sizeof (AsyncContextPrefix) == 3 * sizeof (void *));
967
973
} else {
968
974
auto asyncContextPrefix = reinterpret_cast <FutureAsyncContextPrefix *>(
969
975
reinterpret_cast <char *>(allocation) + headerSize -
970
976
sizeof (FutureAsyncContextPrefix));
977
+ #pragma clang diagnostic push
978
+ #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
971
979
asyncContextPrefix->asyncEntryPoint =
972
980
reinterpret_cast <AsyncGenericClosureEntryPoint *>(function);
981
+ #pragma clang diagnostic pop
973
982
function = future_adapter;
974
983
asyncContextPrefix->closureContext = closureContext;
975
984
assert (sizeof (FutureAsyncContextPrefix) == 4 * sizeof (void *));
@@ -1035,13 +1044,16 @@ swift_task_create_commonImpl(size_t rawTaskCreateFlags,
1035
1044
" with parent %p at base pri %zu" ,
1036
1045
task, task->getTaskId (), parent, basePriority);
1037
1046
1047
+ #pragma clang diagnostic push
1048
+ #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
1038
1049
// Initialize the task-local allocator.
1039
1050
initialContext->ResumeParent =
1040
1051
runInlineOption ? &completeInlineTask
1041
1052
: reinterpret_cast <TaskContinuationFunction *>(
1042
1053
asyncLet ? &completeTask
1043
1054
: closureContext ? &completeTaskWithClosure
1044
1055
: &completeTaskAndRelease);
1056
+ #pragma clang diagnostic pop
1045
1057
if ((asyncLet || (runInlineOption && runInlineOption->getAllocation ())) &&
1046
1058
initialSlabSize > 0 ) {
1047
1059
assert (parent || (runInlineOption && runInlineOption->getAllocation ()));
@@ -1260,10 +1272,13 @@ AsyncTaskAndContext swift::swift_task_create(
1260
1272
FutureAsyncSignature,
1261
1273
SpecialPointerAuthDiscriminators::AsyncFutureFunction>(closureEntry);
1262
1274
1275
+ #pragma clang diagnostic push
1276
+ #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
1263
1277
return swift_task_create_common (
1264
1278
rawTaskCreateFlags, options, futureResultType,
1265
1279
reinterpret_cast <TaskContinuationFunction *>(taskEntry), closureContext,
1266
1280
initialContextSize);
1281
+ #pragma clang diagnostic pop
1267
1282
}
1268
1283
}
1269
1284
@@ -1348,7 +1363,10 @@ void swift_task_future_wait_throwingImpl(
1348
1363
waitingTask->ResumeTask = task_wait_throwing_resume_adapter;
1349
1364
waitingTask->ResumeContext = callContext;
1350
1365
1366
+ #pragma clang diagnostic push
1367
+ #pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
1351
1368
auto resumeFn = reinterpret_cast <TaskContinuationFunction *>(resumeFunction);
1369
+ #pragma clang diagnostic pop
1352
1370
1353
1371
// Wait on the future.
1354
1372
assert (task->isFuture ());
0 commit comments