[Pitch] Language Mode Compiler Condition

You could link to the SE-0212 proposal.


An unknown -language-mode argument must be an error, but an unknown languageMode() argument could be a warning. For example:

#if arch(x86)
//       ^~~
// warning: unknown architecture for build configuration 'arch'
// note: did you mean 'i386'?
#endif

On the other hand, the following compiles without warning (in Xcode 16 beta 5).

#if compiler(>=7) && languageMode(>=7)
#endif

Typos.

2 Likes