Skip to content

tests: fix -Werror,-Wimplicit-int-float-conversion #523

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

Merged
merged 1 commit into from
Sep 24, 2019

Conversation

compnerd
Copy link
Member

testes/dispatch_timer_short.c:58:74: error: implicit conversion from 'unsigned long long' to 'double' may loose precision [-Werror,-Wimplicit-int-float-conversion]
	test_long_less_than("Frequency", 1, (long)ceil((double)delay/(finalCount*interval)));
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~

Fix the casting for finalCount and explicitly cast the result which would be
an unsigned long long due to the multiplication by interval.

```
testes/dispatch_timer_short.c:58:74: error: implicit conversion from 'unsigned long long' to 'double' may loose precision [-Werror,-Wimplicit-int-float-conversion]
	test_long_less_than("Frequency", 1, (long)ceil((double)delay/(finalCount*interval)));
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
```

Fix the casting for `finalCount` and explicitly cast the result which would be
an `unsigned long long` due to the multiplication by `interval`.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@ktopley-apple - okay to merge?

@ktopley-apple ktopley-apple merged commit 87ae119 into swiftlang:master Sep 24, 2019
@compnerd compnerd deleted the test-timer-short branch September 24, 2019 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants