Skip to content

[SR-1615] CoreFoundation should be audited for platform and architecture switches #4147

Open
@phausler

Description

@phausler
Previous ID SR-1615
Radar None
Original Reporter @phausler
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, StarterBug
Assignee None
Priority Medium

md5: 2086366cd1be96fde97f8f4a0e88d88b

Issue Description:

All cases of fully enumerated switches of ported platforms should have a `#error Unsupported Platform` and fully enumerated switches of ported architecture should have a `#error Unsupported Architecture`.

If a code section has cases for all platforms or does not have a fallback case that is portable that the following deployment target macros are satisfied it should have an error case

```
DEPLOYMENT_TARGET_EMBEDDED
DEPLOYMENT_TARGET_EMBEDDED_MINI
DEPLOYMENT_TARGET_FREEBSD
DEPLOYMENT_TARGET_HPUX
DEPLOYMENT_TARGET_IPHONESIMULATOR
DEPLOYMENT_TARGET_LINUX
DEPLOYMENT_TARGET_MACOSX
DEPLOYMENT_TARGET_SOLARIS
DEPLOYMENT_TARGET_WINDOWS
```

Some patterns are currently either ignored in the unsupported case or they only emit a warning; these should be upgraded to an error. Reference https://github.com/apple/swift-corelibs-foundation/blob/master/CoreFoundation/Base.subproj/CFInternal.h#L453 for an example of what would be a fully enumerated switch that has missing elements that should be upgraded to an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions