Skip to content

Commit a549d01

Browse files
committed
stdlib: Resolve -Wmissing-designated-field-initializers warnings.
1 parent 3f42ec2 commit a549d01

File tree

6 files changed

+37
-4
lines changed

6 files changed

+37
-4
lines changed

stdlib/public/runtime/Exclusivity.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ static void reportExclusivityConflict(ExclusivityFlags oldAction, void *oldPC,
138138

139139
RuntimeErrorDetails::Thread secondaryThread = {
140140
.description = oldAccess,
141+
.threadID = 0,
141142
.numFrames = 1,
142143
.frames = &oldPC
143144
};
@@ -148,7 +149,11 @@ static void reportExclusivityConflict(ExclusivityFlags oldAction, void *oldPC,
148149
.framesToSkip = framesToSkip,
149150
.memoryAddress = pointer,
150151
.numExtraThreads = 1,
151-
.threads = &secondaryThread
152+
.threads = &secondaryThread,
153+
.numFixIts = 0,
154+
.fixIts = nullptr,
155+
.numNotes = 0,
156+
.notes = nullptr,
152157
};
153158
_swift_reportToDebugger(RuntimeErrorFlagFatal, message, &details);
154159
}

stdlib/public/runtime/Metadata.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7791,7 +7791,13 @@ diagnoseMetadataDependencyCycle(llvm::ArrayRef<MetadataDependency> links) {
77917791
.errorType = "type-metadata-cycle",
77927792
.currentStackDescription = "fetching metadata", // TODO?
77937793
.framesToSkip = 1, // skip out to the check function
7794-
.memoryAddress = links.front().Value
7794+
.memoryAddress = links.front().Value,
7795+
.numExtraThreads = 0,
7796+
.threads = nullptr,
7797+
.numFixIts = 0,
7798+
.fixIts = nullptr,
7799+
.numNotes = 0,
7800+
.notes = nullptr,
77957801
// TODO: describe the cycle using notes instead of one huge message?
77967802
};
77977803
#pragma GCC diagnostic pop

stdlib/public/runtime/SwiftObject.mm

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,13 @@ static bool isUniquelyReferenced(id object) {
16271627
.errorType = "escaping-closure-violation",
16281628
.currentStackDescription = "Closure has escaped",
16291629
.framesToSkip = 1,
1630+
.memoryAddress = nullptr,
1631+
.numExtraThreads = 0,
1632+
.threads = nullptr,
1633+
.numFixIts = 0,
1634+
.fixIts = nullptr,
1635+
.numNotes = 0,
1636+
.notes = nullptr,
16301637
};
16311638
_swift_reportToDebugger(RuntimeErrorFlagFatal, log, &details);
16321639
}
@@ -1728,7 +1735,13 @@ void swift_objc_swift3ImplicitObjCEntrypoint(id self, SEL selector,
17281735
RuntimeErrorDetails details = {
17291736
.version = RuntimeErrorDetails::currentVersion,
17301737
.errorType = "implicit-objc-entrypoint",
1738+
.currentStackDescription = nullptr,
17311739
.framesToSkip = 1,
1740+
.memoryAddress = nullptr,
1741+
.numExtraThreads = 0,
1742+
.threads = nullptr,
1743+
.numFixIts = 0,
1744+
.fixIts = nullptr,
17321745
.numNotes = 1,
17331746
.notes = &note
17341747
};

stdlib/toolchain/Compatibility50/Overrides.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ struct OverrideSection {
3030
Override_ ## name name;
3131
#include "CompatibilityOverride.def"
3232
};
33-
33+
34+
#pragma clang diagnostic push
35+
#pragma clang diagnostic ignored "-Wmissing-designated-field-initializers"
3436
OverrideSection Swift50Overrides
3537
__attribute__((used, section("__DATA,__swift_hooks"))) = {
3638
.version = 0,
@@ -41,6 +43,7 @@ __attribute__((used, section("__DATA,__swift_hooks"))) = {
4143
// the Compatibility51 library is always linked when the 50 library is.
4244
.conformsToSwiftProtocol = swift51override_conformsToSwiftProtocol,
4345
};
46+
#pragma clang diagnostic pop
4447

4548
// Allow this library to get force-loaded by autolinking
4649
__attribute__((weak, visibility("hidden")))

stdlib/toolchain/Compatibility51/Overrides.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ struct OverrideSection {
2929
Override_ ## name name;
3030
#include "CompatibilityOverride.def"
3131
};
32-
32+
33+
#pragma clang diagnostic push
34+
#pragma clang diagnostic ignored "-Wmissing-designated-field-initializers"
3335
OverrideSection Swift51Overrides
3436
__attribute__((used, section("__DATA,__swift51_hooks"))) = {
3537
.version = 0,
3638
.conformsToSwiftProtocol = swift51override_conformsToSwiftProtocol,
3739
};
40+
#pragma clang diagnostic pop
3841

3942
// Allow this library to get force-loaded by autolinking
4043
__attribute__((weak, visibility("hidden")))

stdlib/toolchain/Compatibility56/Overrides.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ struct ConcurrencyOverrideSection {
3939

4040
#undef OVERRIDE
4141

42+
#pragma clang diagnostic push
43+
#pragma clang diagnostic ignored "-Wmissing-designated-field-initializers"
4244
__attribute__((visibility("hidden")))
4345
ConcurrencyOverrideSection Swift56ConcurrencyOverrides
4446
__attribute__((used, section("__DATA,__s_async_hook"))) = {
@@ -55,6 +57,7 @@ RuntimeOverrideSection Swift56RuntimeOverrides
5557
__attribute__((used, section("__DATA,__swift56_hooks"))) = {
5658
.version = 0,
5759
};
60+
#pragma clang diagnostic pop
5861

5962
// Allow this library to get force-loaded by autolinking
6063
__attribute__((weak, visibility("hidden")))

0 commit comments

Comments
 (0)