Skip to content

Commit 11165f3

Browse files
committed
NFC: Ignore some -Wcast-qual warnings in swift-reflection-test.c.
1 parent 72e0fc2 commit 11165f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stdlib/tools/swift-reflection-test/swift-reflection-test.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ static int PipeMemoryReader_queryDataLayout(void *Context,
187187

188188
static void PipeMemoryReader_freeBytes(void *reader_context, const void *bytes,
189189
void *context) {
190+
#pragma clang diagnostic push
191+
#pragma clang diagnostic ignored "-Wcast-qual"
190192
free((void *)bytes);
193+
#pragma clang diagnostic pop
191194
}
192195

193196
static
@@ -652,10 +655,13 @@ int reflectEnumValue(SwiftReflectionContextRef RC,
652655
void *outFreeContext = NULL;
653656
// !!! FIXME !!! obtain the pointer by properly projecting the enum value
654657
// Next lines are a hack to prove the concept.
658+
#pragma clang diagnostic push
659+
#pragma clang diagnostic ignored "-Wcast-qual"
655660
const void *rawPtr
656661
= PipeMemoryReader_readBytes((void *)&Pipe, EnumInstance, 8, &outFreeContext);
657662
uintptr_t instance = *(uintptr_t *)rawPtr & 0xffffffffffffff8ULL;
658663
PipeMemoryReader_freeBytes((void *)&Pipe, rawPtr, outFreeContext);
664+
#pragma clang diagnostic pop
659665

660666
// Indirect enum stores the payload as the first field of a closure context
661667
swift_typeinfo_t TI = swift_reflection_infoForInstance(RC, instance);

0 commit comments

Comments
 (0)