Skip to content

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

Merged
merged 1 commit into from
Aug 2, 2017

Conversation

dgrove-oss
Copy link
Contributor

Fixes to build the extended test suite
(not built/run under Swift CI) when using
the expanded set of compiler warning flags.

@dgrove-oss
Copy link
Contributor Author

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).

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);
Copy link
Contributor

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)
Copy link
Contributor

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

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);
Copy link
Contributor

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...

@@ -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);
Copy link
Contributor

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.
@dgrove-oss dgrove-oss force-pushed the fix-warnings-extended-tests branch from 1ca6fa6 to 820d638 Compare August 1, 2017 19:14
@dgrove-oss
Copy link
Contributor Author

fixed the bad indentation.

@das
Copy link
Contributor

das commented Aug 2, 2017

thanks!

@das das merged commit 8cdaf53 into swiftlang:master Aug 2, 2017
atrick added a commit to atrick/swift-corelibs-libdispatch that referenced this pull request Aug 2, 2017
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.
@atrick
Copy link
Contributor

atrick commented Aug 2, 2017

I accidentally reverted this and reapplied it here:
#293

@dgrove-oss dgrove-oss deleted the fix-warnings-extended-tests branch August 7, 2017 15:54
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