Many new warnings after Xcode upgrade


Graham Cox
 

I just updated to XCode 12.1, and my project is throwing a lot of new warnings about “double-quoted include in framework header”. This appears to be because of the build setting “Quoted include in Framework Header”, which is now a recommended setting.

I can turn that off again, but what is this treally trying to tell me? These warnings appear to be bogus, in that yes, I’m building several frameworks as part of my workspace, but surely the files within those framework sources should be simple double quotes, not refer to the framework headers - after all, it’s the framework I’m building!

I’m confused, but perhaps it’s because my project structure is incorrect. But I don’t want to go and change a whole bunch of stuff before I properly understand what should be done here.

Example errors in the output — note, this framework is one I just use “as is”, I’m not even building it (Sparkle).


—Graham



Alex Zavatone
 

I’d check to see why it expects < > angle brackets but it seems as if you’ve done all the research.

This seems to point in the right direction.


There are several links on that page that point to cases where people have resolved this.

Cheers,
Alex Zavatone

On Oct 28, 2020, at 7:01 PM, Graham Cox <graham@...> wrote:

I just updated to XCode 12.1, and my project is throwing a lot of new warnings about “double-quoted include in framework header”. This appears to be because of the build setting “Quoted include in Framework Header”, which is now a recommended setting.

I can turn that off again, but what is this treally trying to tell me? These warnings appear to be bogus, in that yes, I’m building several frameworks as part of my workspace, but surely the files within those framework sources should be simple double quotes, not refer to the framework headers - after all, it’s the framework I’m building!

I’m confused, but perhaps it’s because my project structure is incorrect. But I don’t want to go and change a whole bunch of stuff before I properly understand what should be done here.

Example errors in the output — note, this framework is one I just use “as is”, I’m not even building it (Sparkle).

<Screen Shot 2020-10-29 at 10.53.51 am.png>

—Graham




Jim Adams
 

I was wondering about that myself. I have header files that are internal to the framework so shouldn’t be public.

 

From: <cocoa@apple-dev.groups.io> on behalf of "Graham Cox via groups.io" <graham@...>
Reply-To: "cocoa@apple-dev.groups.io" <cocoa@apple-dev.groups.io>
Date: Wednesday, October 28, 2020 at 8:02 PM
To: "cocoa@apple-dev.groups.io" <cocoa@apple-dev.groups.io>
Subject: [cocoa-dev] Many new warnings after Xcode upgrade

 

EXTERNAL

I just updated to XCode 12.1, and my project is throwing a lot of new warnings about “double-quoted include in framework header”. This appears to be because of the build setting “Quoted include in Framework Header”, which is now a recommended setting.

 

I can turn that off again, but what is this treally trying to tell me? These warnings appear to be bogus, in that yes, I’m building several frameworks as part of my workspace, but surely the files within those framework sources should be simple double quotes, not refer to the framework headers - after all, it’s the framework I’m building!

 

I’m confused, but perhaps it’s because my project structure is incorrect. But I don’t want to go and change a whole bunch of stuff before I properly understand what should be done here.

 

Example errors in the output — note, this framework is one I just use “as is”, I’m not even building it (Sparkle).

 

 

—Graham

 

 


Quincey Morris
 

I don’t have any special insights, but I think the warning is correct in that there has for some time been an (unwritten?) rule that the #imports *inside* a framework header should use angle brackets — for self-preservation.

Again with no special knowledge, that makes sense to me because imports with double-quotes will search the framework *client’s* include paths first, and that’s almost certainly wrong if there are any symbol conflicts with what’s defined in the framework.

OTOH, it’s hard to predict the effect of “fixing” the bracketing, because Xcode’s behavior here is somewhat inscrutable.

All that said, my suggestion is as follows:

1. Commit your project as-is to the repository.

2. Apply all the “Double-quoted include …” warning fixits automatically.

3. Build and run the project.

If that works, don’t lose any sleep. If something blows up, discard changes and silence the warnings, and don’t lose any sleep. :)

On Oct 29, 2020, at 05:45 , Jim Adams via groups.io <jim.adams@...> wrote:

I was wondering about that myself. I have header files that are internal to the framework so shouldn’t be public.
 
From: <cocoa@apple-dev.groups.io> on behalf of "Graham Cox via groups.io" <graham@...>
Reply-To: "cocoa@apple-dev.groups.io" <cocoa@apple-dev.groups.io>
Date: Wednesday, October 28, 2020 at 8:02 PM
To: "cocoa@apple-dev.groups.io" <cocoa@apple-dev.groups.io>
Subject: [cocoa-dev] Many new warnings after Xcode upgrade
 
EXTERNAL
I just updated to XCode 12.1, and my project is throwing a lot of new warnings about “double-quoted include in framework header”. This appears to be because of the build setting “Quoted include in Framework Header”, which is now a recommended setting. 
 
I can turn that off again, but what is this treally trying to tell me? These warnings appear to be bogus, in that yes, I’m building several frameworks as part of my workspace, but surely the files within those framework sources should be simple double quotes, not refer to the framework headers - after all, it’s the framework I’m building!
 
I’m confused, but perhaps it’s because my project structure is incorrect. But I don’t want to go and change a whole bunch of stuff before I properly understand what should be done here.
 
Example errors in the output — note, this framework is one I just use “as is”, I’m not even building it (Sparkle).
 
<image001.png>
 
—Graham
 
 



Alex Zavatone
 

On Oct 29, 2020, at 7:16 PM, Quincey Morris <quinceymorris@rivergatesoftware.com> wrote:

I don’t have any special insights, but I think the warning is correct in that there has for some time been an (unwritten?) rule that the #imports *inside* a framework header should use angle brackets — for self-preservation.

Again with no special knowledge, that makes sense to me because imports with double-quotes will search the framework *client’s* include paths first, and that’s almost certainly wrong if there are any symbol conflicts with what’s defined in the framework.

That makes perfect sense. Is the header the umbrella header for the framework? Is so, then the < > brackets would make more sense since they would restrict searching for headers inside the framework (if I understand this correctly.)

In that case, I’d expect just replacing the quotes with < > and rebuilding may be just what is needed.

Cheers.

Alex Zavatone