Skip to content

Upgrade xcode project to latest Recommended Settings #1280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2017

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Oct 21, 2017

  • This enables more clang warnings which finds some issues
    in the CoreFoundation code. Fix some of these.

@spevans
Copy link
Contributor Author

spevans commented Oct 21, 2017

@swift-ci please test

@@ -496,8 +496,8 @@ static CFMessagePortRef __CFMessagePortCreateRemote(CFAllocatorRef allocator, CF
ctx.retain = NULL;
ctx.release = NULL;
ctx.copyDescription = NULL;
task_get_bootstrap_port(mach_task_self(), &bp);
native = (KERN_SUCCESS == ret) ? CFMachPortCreateWithPort(allocator, port, __CFMessagePortDummyCallback, &ctx, NULL) : NULL;
ret = task_get_bootstrap_port(mach_task_self(), &bp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These couple of lines may need a quick eyeball by @phausler -- the direct context in the GitHub view doesn't necessarily determine that these changes are valid. What was the warning that you were trying to fix here? Unused return or local variable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So looking at the changes they look sensible in the context of this change, but it would be good to see if the fixes can be upstreamed efficiently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they were both reads before being initialised, but the port -> bp fix is more of an educated guess :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is what you want actually. This function really shouldn't exist at all in this environment.

The core idea here is to look up the port by name but that part is missing. We should probably just replace the entire thing with return NULL.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to keep the rest of the code for some reason (documentation purposes?) then we should not bother with task_get_bootstrap_port and just make sure port == NULL for the rest of the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the function can be replaced with a return NULL then it would be better to just do that. The old body will still be in git for the curious.

@alblue alblue requested a review from phausler October 23, 2017 12:07
@spevans spevans force-pushed the pr_upgrade_xcode_project branch from 0b97102 to e982642 Compare October 24, 2017 18:41
@spevans
Copy link
Contributor Author

spevans commented Oct 24, 2017

I removed the CFMessagePort.c changes for now, they can be done in a future PR if its still warranted.

@spevans
Copy link
Contributor Author

spevans commented Oct 24, 2017

@swift-ci please test

1 similar comment
@spevans
Copy link
Contributor Author

spevans commented Oct 24, 2017

@swift-ci please test

@@ -2763,7 +2775,6 @@
"-DCF_CHARACTERSET_UNICODE_DATA_B=\\\\\"CoreFoundation/CharacterSets/CFUnicodeData-B.mapping\\\\\"",
"-DCF_CHARACTERSET_UNICHAR_DB=\\\\\"CoreFoundation/CharacterSets/CFUniCharPropertyDatabase.data\\\\\"",
"-DCF_CHARACTERSET_BITMAP=\\\\\"CoreFoundation/CharacterSets/CFCharacterSetBitmaps.bitmap\\\\\"",
"-Wno-nullability-completeness-on-arrays",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this removed by the upgrade process? Is it implied by default now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I removed it manually. It was added in #988 but
a) I think its a useful warning to have,
b) The build.ninja doesnt have this flag so these warnings currently show up on Linux anyway and so this keeps the two builds in sync.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, makes sense.

@alblue
Copy link
Contributor

alblue commented Nov 2, 2017

Given that Xcode 9.1 has been released, can you see if there are other changes which get added as part of that, and resubmit a newer version?

@spevans
Copy link
Contributor Author

spevans commented Nov 2, 2017

@alblue Apart from bumping the LastUpgradeCheck from 0900 to 0910 there were no other changes.

@spevans
Copy link
Contributor Author

spevans commented Nov 7, 2017

@alblue Any other issues with this?

@ianpartridge
Copy link
Contributor

Should we change the LastUpgradeVersion to 0910?

P.S. 👍 to this PR.

@spevans
Copy link
Contributor Author

spevans commented Nov 7, 2017

I'll update to the latest and rebase just to tick that box then we can merge it

- This enables more clang warnings which finds some issues
  in the CoreFoundation code. Fix some of these.
@alblue
Copy link
Contributor

alblue commented Nov 7, 2017

Sounds good.

@spevans spevans force-pushed the pr_upgrade_xcode_project branch from e982642 to 86bd361 Compare November 7, 2017 15:19
@spevans
Copy link
Contributor Author

spevans commented Nov 10, 2017

@alblue I bumped the LastUpgradeCheck to 0910. Is this good to go now?

@alblue alblue merged commit 51668e0 into swiftlang:master Nov 10, 2017
@alblue
Copy link
Contributor

alblue commented Nov 10, 2017

Works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants