Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dhoepfl opened this issue Nov 6, 2020 · 2 comments
Open

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

dhoepfl opened this issue Nov 6, 2020 · 2 comments

Comments

@dhoepfl
Copy link
Contributor

dhoepfl commented Nov 6, 2020

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.

@typesanitizer
Copy link

@swift-ci create

@dhoepfl
Copy link
Contributor Author

dhoepfl commented Nov 10, 2020

Partially (lstat-part) fixed by pull request #2919.

Did not touch the import part since I’m not sure how it is intended to be.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants