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-8858] Format specifier warning compiling swift-4.2-RELEASE #51364

Closed
kevints mannequin opened this issue Sep 26, 2018 · 5 comments
Closed

[SR-8858] Format specifier warning compiling swift-4.2-RELEASE #51364

kevints mannequin opened this issue Sep 26, 2018 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@kevints
Copy link
Mannequin

kevints mannequin commented Sep 26, 2018

Previous ID SR-8858
Radar None
Original Reporter @kevints
Type Bug
Status Resolved
Resolution Won't Do
Environment

Ubuntu 14.04
Swift 4.2-RELEASE

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

md5: ad362b43431a36d6803d8cf79b1cb4f1

Issue Description:

[78/865] Building CXX object stdlib/public/runtime/CMakeFiles/swiftRuntime-linux-x86_64.dir/SwiftDtoa.cpp.o
/code/swift/stdlib/public/runtime/SwiftDtoa.cpp:1072:43: warning: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Wformat]
                         sign, signaling, payload);
                                          ^~~~~~~
/code/swift/stdlib/public/runtime/SwiftDtoa.cpp:1128:43: warning: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Wformat]
                         sign, signaling, payload);
                                          ^~~~~~~
@belkadan
Copy link
Contributor

cc @stephentyrone

@stephentyrone
Copy link
Member

This would appear to be a bug in the C headers or compiler in use on that platform. The actual print statement uses `PRIx64` from <inttypes.h>, which should always be the correct formatter for `uint64_t`, which is the type of `payload`.

@kevints
Copy link
Mannequin Author

kevints mannequin commented Oct 1, 2018

@stephentyrone it looks like master is using PRIx64 in place of %llx (as part of 97a934c412a26f0222f57d5e4cd7467a516eb6af) however this change did not make it into the branch that was ultimately used for swift-4.2-RELEASE (see https://github.com/apple/swift/blob/swift-4.2-RELEASE/stdlib/public/runtime/SwiftDtoa.cpp#L1071). Do we need to backport a fix?

@kevints
Copy link
Mannequin Author

kevints mannequin commented Oct 1, 2018

PR: #19643

@stephentyrone
Copy link
Member

It's not at all clear to me that we should be making changes to 4.2 branch only to quiet a warning (the actual behavior is correct on all supported targets--this is just some extra build noise). This is fixed going forward on master, and we probably want to leave it at that.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants