Xcode still inserts `-suppress-warnings` into builds

Hey everyone,

this is a difficult topic to pin down on a certain component but I don't want to assign blame anyway. I want it to go away.

Looks like people started to see this somewhere at Xcode 15 but it keeps happening. Xcode 26.5 as of this writing. For Apple people reading this, I posted a bug/feedback FB20206100 including a ready-to-compile (or rather fail-to-compile) example project.

The gist is: If you open a Package.swift file with Xcode and that package contain a sub-package, Xcode will insert -suppress-warnings into the build of said sub-package.

This means if you add "swiftSettings: [.unsafeFlags(["-warnings-as-errors"])]" into that sub-packages Package.swift file, it wont compile.

Why? Because:

error: Conflicting options '-warnings-as-errors' and '-suppress-warnings'

When you look into the fairly recently accepted swift evolution propsal 0443 they basically say "That's fine. Nothing to see here." or as the proposal put it:

Interaction with -suppress-warnings

This proposal deliberately excludes -suppress-warnings and its group-based counterpart from the new unified model. We retain the behavior of the existing -suppress-warnings flag but forbid its usage with the new options. The following rules will be applied:

It is forbidden to combine -suppress-warnings with -Wwarning or -Werror. The compiler will produce an error if these options are present in the command line together.

It is allowed to be combined with -no-warnings-as-errors. The current compiler behavior permits the usage of -no-warnings-as-errors or -warnings-as-errors -no-warnings-as-errors with -suppress-warnings. We will maintain this behavior.

I don't care who is right or wrong here but the bottom line is that if you use sub-packages you are effectively being errored out of using "-warnings-as-errors" for (IMHO) no good reason.

Could Please someone look at this and say "Yeah, that doesn't look right, let's fix this".

Please

Thank You

Roddi

P.S.: Yes, I know there have been posts before that are lamenting this. But I thought, Let's try a fresh start here.

Xcode still inserts `-suppress-warnings` into builds
 
 
Q