-
Notifications
You must be signed in to change notification settings - Fork 471
Fix compilation warnings in extended test suite #290
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
Conversation
The vast majority are related to resolving size_t vs. long. I selectively added test_sizet_ functions to bsdtests.h as the most contained way to resolve these. (I think test_sizet_COMPAREOP reads better than test_size_t_COMPAREOP, but if you disagree it can be changed easily). |
tests/dispatch_priority.c
Outdated
n_blocks(void) | ||
{ | ||
static dispatch_once_t pred; | ||
static int n; | ||
dispatch_once(&pred, ^{ | ||
#ifdef __linux__ | ||
n = sysconf(_SC_NPROCESSORS_CONF); | ||
n = (int)sysconf(_SC_NPROCESSORS_CONF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad indent ?
@@ -189,6 +189,20 @@ test_long_format(long actual, long expected, const char* format, ...) | |||
} | |||
|
|||
void | |||
_test_sizet(const char* file, long line, const char* desc, size_t actual, size_t expected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reads odd but I agree test_size_t
is not much better, I don't feel strongly either way
tests/dispatch_io.c
Outdated
total_size += size; | ||
files_opened++; | ||
test_async_read(node->fts_path, size, option, queue, ^(size_t len){ | ||
OSAtomicAdd32(len, bytes); | ||
OSAtomicAdd32((int32_t)len, (volatile int32_t *)bytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad indent
we should probably convert the testsuite to stdatomic.h at some point...
tests/dispatch_read2.c
Outdated
@@ -71,7 +71,7 @@ dispatch_read2(dispatch_fd_t fd, | |||
test_stop(); | |||
} | |||
dispatch_source_t reader = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, | |||
fd, 0, queue); | |||
(uintptr_t)fd, 0, queue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very bad indent ;-)
Fixes to build the extended test suite (not built/run under Swift CI) when using the expanded set of compiler warning flags.
1ca6fa6
to
820d638
Compare
fixed the bad indentation. |
thanks! |
This restores pull request swiftlang#290 from dgrove-oss/fix-warnings-extended-tests. This was an accidental revert. Somehow the revert button on github led me to the wrong PR.
I accidentally reverted this and reapplied it here: |
Fixes to build the extended test suite
(not built/run under Swift CI) when using
the expanded set of compiler warning flags.