Skip to content

[SR-13831] Warnings while building on Linux #3240

Open
@dhoepfl

Description

@dhoepfl
Previous ID SR-13831
Radar rdar://problem/71122020
Original Reporter @dhoepfl
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Improvement
Assignee None
Priority Medium

md5: fb7ced6742bc6d687df5ea1589e7d36e

Issue Description:

When building swift on Linux, there are two warnings that I see a lot:

/home/myhome/llvm/swift-source/build/buildbot_linux/foundation-linux-x86_64/CoreFoundation.framework/Headers/ForSwiftFoundationOnly.h:610:12: warning: implicit declaration of function 'lstat' is invalid in C99 [-Wimplicit-function-declaration]
    return lstat(filename, buffer) == 0 ? 0 : errno;

and

/home/myhome/llvm/swift-source/swift-corelibs-foundation/Sources/Foundation/RunLoop.swift:11:8:
warning: 'CoreFoundation' inconsistently imported as implementation-only
import CoreFoundation
       ^
@_implementationOnly
/home/myhome/llvm/swift-source/swift-corelibs-foundation/Sources/Foundation/Bridging.swift:13:29
: note: imported as implementation-only here
@_implementationOnly import CoreFoundation
                            ^

In a full build, the first one appears 160 times, the second one 399 times.
Thats 19%/47% (66%) of all 843 warnings I see in a full swift build.

Both swift-corelibs-foundation/CoreFoundation/Base.subproj/CoreFoundation.h, and swift-corelibs-foundation/CoreFoundation/Base.subproj/SwiftRuntime/CoreFoundation.h currently import <sys/types.h> but lack <sys/stat.h> (and <unistd.h>).

I’m think CoreFoundation should be imported implementation-only since all other files in swift-corelibs-foundation/Sources/Foundation import it like that. Both files where introduced in the same commit fd7c1e9.

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