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

Fixed build error under Android NDK #162

Merged
merged 1 commit into from
Nov 27, 2018
Merged

Fixed build error under Android NDK #162

merged 1 commit into from
Nov 27, 2018

Conversation

tals
Copy link
Contributor

@tals tals commented Nov 16, 2018

Description

This allow doctest to build cleanly with the Android NDK, using the clang compiler targeting arm64

Without it, clang will complain about

cannot initialize a member subobject of type 'int' with an rvalue of type 'nullptr_t'
            struct sigaction sa = {nullptr};
                                   ^~~~~~~

Otherwise clang will complain about
```
cannot initialize a member subobject of type 'int' with an rvalue of type 'nullptr_t'
            struct sigaction sa = {nullptr};
                                   ^~~~~~~
```
@onqtam onqtam merged commit bd347ec into doctest:dev Nov 27, 2018
@onqtam
Copy link
Member

onqtam commented Nov 27, 2018

Thanks!

I'll also commit warning suppressions around that piece of code because of not using nullptr with other compilers

@@ -1430,7 +1430,7 @@ namespace {
sigStack.ss_size = sizeof(altStackMem);
sigStack.ss_flags = 0;
sigaltstack(&sigStack, &oldSigStack);
struct sigaction sa = {nullptr};
struct sigaction sa = {0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be struct sigaction sa{}?

I'm not sure if this initializes all the struct members, whereas value-initialization will.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually you are right!

onqtam added a commit that referenced this pull request Nov 27, 2018
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