Skip to content

Commit 4799f1e

Browse files
committed
Concurrency: Suppress some warnings.
1 parent 2b8d1be commit 4799f1e

File tree

5 files changed

+27
-0
lines changed

5 files changed

+27
-0
lines changed

stdlib/public/Concurrency/Actor.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,13 @@ void swift::swift_task_reportUnexpectedExecutor(
653653
.errorType = "actor-isolation-violation",
654654
.currentStackDescription = "Actor-isolated function called from another thread",
655655
.framesToSkip = 1,
656+
.memoryAddress = nullptr,
657+
.numExtraThreads = 0,
658+
.threads = nullptr,
659+
.numFixIts = 0,
660+
.fixIts = nullptr,
661+
.numNotes = 0,
662+
.notes = nullptr,
656663
};
657664
_swift_reportToDebugger(
658665
isFatalError ? RuntimeErrorFlagFatal : RuntimeErrorFlagNone, message,

stdlib/public/Concurrency/DispatchGlobalExecutor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ struct MinimalDispatchObjectHeader {
6969

7070
#pragma clang diagnostic push
7171
#pragma clang diagnostic ignored "-Wgnu-offsetof-extensions"
72+
#pragma clang diagnostic push
73+
#pragma clang diagnostic ignored "-Winvalid-offsetof"
7274
static_assert(
7375
offsetof(Job, metadata) == offsetof(MinimalDispatchObjectHeader, VTable),
7476
"Job Metadata field must match location of Dispatch VTable field.");
@@ -77,6 +79,7 @@ static_assert(offsetof(Job, SchedulerPrivate[Job::DispatchLinkageIndex]) ==
7779
"Dispatch Linkage field must match Job "
7880
"SchedulerPrivate[DispatchLinkageIndex].");
7981
#pragma clang diagnostic pop
82+
#pragma clang diagnostic pop
8083

8184
/// The function passed to dispatch_async_f to execute a job.
8285
static void __swift_run_job(void *_job) {

stdlib/public/Concurrency/ExecutorChecks.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ static_assert((SwiftJobPriority)swift::JobPriority::Background
5151
static_assert((SwiftJobPriority)swift::JobPriority::Unspecified
5252
== SwiftUnspecifiedJobPriority);
5353

54+
#pragma clang diagnostic push
55+
#pragma clang diagnostic ignored "-Winvalid-offsetof"
5456
// Job (has additional fields not exposed via SwiftJob)
5557
static_assert(sizeof(swift::Job) >= sizeof(SwiftJob));
5658
static_assert(offsetof(swift::Job, metadata) == offsetof(SwiftJob, metadata));
@@ -63,6 +65,7 @@ static_assert(offsetof(swift::Job, SchedulerPrivate) == offsetof(SwiftJob, sched
6365
static_assert(offsetof(swift::Job, SchedulerPrivate[0]) == offsetof(SwiftJob, schedulerPrivate[0]));
6466
static_assert(offsetof(swift::Job, SchedulerPrivate[1]) == offsetof(SwiftJob, schedulerPrivate[1]));
6567
static_assert(offsetof(swift::Job, Flags) == offsetof(SwiftJob, flags));
68+
#pragma clang diagnostic pop
6669

6770
// SerialExecutorRef
6871
static_assert(sizeof(swift::SerialExecutorRef) == sizeof(SwiftExecutorRef));

stdlib/public/Concurrency/TaskGroup.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,13 @@ struct TaskGroupStatus {
606606
.errorType = "task-group-violation",
607607
.currentStackDescription = "TaskGroup exceeded supported pending task count",
608608
.framesToSkip = 1,
609+
.memoryAddress = nullptr,
610+
.numExtraThreads = 0,
611+
.threads = nullptr,
612+
.numFixIts = 0,
613+
.fixIts = nullptr,
614+
.numNotes = 0,
615+
.notes = nullptr,
609616
};
610617
_swift_reportToDebugger(RuntimeErrorFlagFatal, message, &details);
611618
}

stdlib/public/Concurrency/TaskLocal.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,13 @@ static void swift_task_reportIllegalTaskLocalBindingWithinWithTaskGroupImpl(
338338
.errorType = "task-local-violation",
339339
.currentStackDescription = "Task-local bound in illegal context",
340340
.framesToSkip = 1,
341+
.memoryAddress = nullptr,
342+
.numExtraThreads = 0,
343+
.threads = nullptr,
344+
.numFixIts = 0,
345+
.fixIts = nullptr,
346+
.numNotes = 0,
347+
.notes = nullptr,
341348
};
342349
_swift_reportToDebugger(RuntimeErrorFlagFatal, message, &details);
343350
}

0 commit comments

Comments
 (0)