Skip to content

Commit 97a73c2

Browse files
authored
Merge pull request #9661 from DougGregor/se-0160-log-by-default
[SE-0160] Emit runtime warnings by default.
2 parents 837a180 + 571853d commit 97a73c2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

stdlib/public/runtime/SwiftObject.mm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,18 +1364,19 @@ static bool usesNativeSwiftReferenceCounting_nonNull(
13641364
SWIFT_RUNTIME_EXPORT
13651365
void swift_objc_swift3ImplicitObjCEntrypoint(id self, SEL selector) {
13661366
// Figure out how much reporting we want by querying the environment
1367-
// variable SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT. We have four
1367+
// variable SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT. We have four meaningful
13681368
// levels:
13691369
//
13701370
// 0: Don't report anything
13711371
// 1: Complain about uses of implicit @objc entrypoints.
13721372
// 2: Complain about uses of implicit @objc entrypoints, with backtraces
13731373
// if possible.
1374-
// 3: Complain about uses of implicit @objc entrypoints, with backtraces
1375-
// if possible, then abort().
1374+
// 3: Complain about uses of implicit @objc entrypoints, then abort().
13761375
//
13771376
// The actual reportLevel is stored as the above values +1, so that
13781377
// 0 indicates we have not yet checked. It's fine to race through here.
1378+
//
1379+
// The default, if SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT is not set, is 2.
13791380
static int storedReportLevel = 0;
13801381
if (storedReportLevel == 0) {
13811382
auto reportLevelStr = getenv("SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT");
@@ -1384,7 +1385,7 @@ void swift_objc_swift3ImplicitObjCEntrypoint(id self, SEL selector) {
13841385
reportLevelStr[1] == 0)
13851386
storedReportLevel = (reportLevelStr[0] - '0') + 1;
13861387
else
1387-
storedReportLevel = 1;
1388+
storedReportLevel = 3;
13881389
}
13891390

13901391
int reportLevel = storedReportLevel - 1;

test/Interpreter/SDK/objc_swift3_deprecated_objc_inference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: rm -rf %t && mkdir -p %t
22
// RUN: %target-build-swift -swift-version 4 -Xfrontend -enable-swift3-objc-inference %s -o %t/a.out
3-
// RUN: %target-run %t/a.out 2>&1 | %FileCheck %s -check-prefix=CHECK_NOTHING
3+
// RUN: %target-run %t/a.out 2>&1 | %FileCheck %s -check-prefix=CHECK_WARNINGS
44
// RUN: env SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT=0 SIMCTL_CHILD_SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT=0 %target-run %t/a.out 2>&1 | %FileCheck %s -check-prefix=CHECK_NOTHING
55

66
// RUN: env SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT=1 SIMCTL_CHILD_SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT=2 %target-run %t/a.out > %t/level1.log 2>&1

0 commit comments

Comments
 (0)