-
Notifications
You must be signed in to change notification settings - Fork 149
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
Fix use of pow in separateFractionalSecond #260
Conversation
d4f4aa8
to
9012cdc
Compare
How are you hitting that error? Is that a compile time error or runtime? This shouldn’t be happening as best I can tell. |
@jpsim It's a compile error, we hit it when building the Swift toolchain on Ubuntu 18.04. |
That's odd. Can you please share steps to reproduce the issue? I'm not seeing that on Ubuntu 18.04 with Swift 5.2.2 (also tested with Swift 5.2.3):
|
I'm building from https://github.com/apple/swift/tree/tensorflow-merge. The closest toolchain would be https://github.com/apple/swift/releases/tag/swift-DEVELOPMENT-SNAPSHOT-2020-05-18-a, I think. |
Looks like we're not getting the right |
@asuhan if you qualify, you need to qualify for multiple targets, but of course it would work when qualified. The problem here is that pow is not a real function. The functions are powf, powl, and powll. pow is a swift extension to add a type generic function a la C11. The qualified name is exactly that and is why it works. This might just be a race condition: import System/Glibc/MSVCT and it should work. The typed function is just directly going to the underlying libc function and is cheaper though. |
@compnerd I've already tried to import System/Glibc/MSVCT and didn't get it to work. If I convert to powl, I get:
If I don't, I get:
Also, note that I'm only qualifying it for Linux in the current version of the patch, other targets appear to be happy with it. |
@asuhan could you please file a bug at https://bugs.swift.org? I'd consider it a Swift bug if |
Turns out the issue is specific to the TF branch: asuhan#1. Sorry! |
I’m glad you got to the bottom of this. |
Fixes the
Yams/Representer.swift:130:21: error: static member 'pow' cannot be used on instance of type 'Double'
we hit.