Xcode 6.1.1: Warnings on XCAbstractTest.h, XCTestCase.h, and XCTestSuite.h

Originator:igeek1
Number:rdar://20038246 Date Originated:04-Mar-2015 11:07 AM
Status:Duplicate of 15775382 Resolved:06-Mar-2015 06:54 PM
Product:Developer Tools Product Version:Xcode 6.1.1 (6A2008a)
Classification:Serious Bug Reproducible:Always
 
Summary:
When I add some strict warnings, Xcode throws warnings on some Apple headers that I have no control over.

Steps to Reproduce:
1. Create a new Xcode project via File → New → Project. Choose iOS → Application → Single View Application.
2. For Product Name, type MyApp. Choose Objective-C and Universal. Save the project.
3. Build the project with CommandB. Run the tests with CommandU. Observe that they both finish with no errors or warnings.
4. Click on the Project to go to the Project Settings.
5. Click on the blue MyApp Project (as opposed to MyApp or MyAppTests targets).
6. Click on the Build Settings tab.
7. Search for Other Warning Flags.
8. Enter the following string for the Other Warning Flags for the app: -Weverything -Wno-objc-missing-property-synthesis -Wno-objc-property-synthesis -Wno-direct-ivar-access -Wno-assign-enum -Wno-float-equal -Wno-sign-compare -Wno-switch-enum -Wno-gnu -Wnewline-eof
9. Build the app again. You should see three or four warnings about treating #import as @import, which is expected given the warnings you just enabled.
10. Clean the project with CommandShiftK
11. Build again. You may see extra warnings. If not, then you need to…
12. Delete the DerivedData folder, at least for this project. It is located at /Library/Developer/Xcode/DerivedData/MyApp-*, where * is some random identifier string. You may also need to delete /Library/Developer/Xcode/DerivedData/ModuleCache.
13. Clean and build again. And again. It may take a few times. Eventually...
14. You will see code and documentation warnings on XCAbstractTest.h, XCTestCase.h, and XCTestSuite.h. See attached screenshot.

Expected Results:
No warnings besides the #import → @import ones.

Actual Results:
Warnings on XCAbstractTest.h, XCTestCase.h, and XCTestSuite.h. See attached screenshot.

Regression:
This seems to have happened recently, perhaps as of Xcode 6? But I don’t have an exact regression.

Notes:
Originally posted on Stack Overflow: http://stackoverflow.com/questions/28844616/warnings-on-xcabstracttest-h-xctestcase-h-and-xctestsuite-h
Attached screenshot and sample project that reproduces the problem on my computer.
Attachments also uploaded here: http://cl.ly/a2Li

Comments

I have found a workaround: ignore the problem warnings in the test target only. Here's a partial diff of the pbxproj:

  • WARNING_CFLAGS = (
  • "$(inherited)",
  • "-Wno-documentation-unknown-command",
  • "-Wno-auto-import",
  • "-Wno-incomplete-module",
  • );

Also posted on Stack Overflow: http://stackoverflow.com/questions/28844616/warnings-on-xcabstracttest-h-xctestcase-h-and-xctestsuite-h

Engineering has determined that your bug report is a duplicate of another issue and will be closed.

Another new piece of information: when I build in Xcode 6.3b2, I get an additional warning about "building module 'UIKit'". See screenshot: http://cl.ly/a3sK

Note that, when I reproduce the same steps as in Sam's video on my computer, I am not able to get rid of the extra warnings. They always come back. Possible differences between my and Sam's setups:

Sam is on Xcode 6.1, while I am on 6.1.1

Sam is on Mavericks, while I am on Yosemite (10.10.2).

The issue appears to be at least partly related to where Derived Data is stored. See screen recording, courtesy of Sam Marshall (@dirk_gently), for details: http://cl.samdmarshall.com/a4Hy


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!