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

Fix various Linux/GCC build issues by being more standards conformant. #6

Merged
merged 3 commits into from
May 13, 2015

Conversation

jpetso
Copy link
Contributor

@jpetso jpetso commented May 11, 2015

This is mostly including the right headers in the right places,
plus a few fixes for type declarations.

(Context: I'm trying to create a CMake build for CBForest. These are the changes I've got so far that improve the code without requiring any build changes.)

This is mostly including the right headers in the right places,
plus a few fixes for type declarations.
.body = (void*)body.buf,
.bodylen = body.size,
};
fdb_doc doc;
Copy link
Contributor

Choose a reason for hiding this comment

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

For safety this line should be fdb_doc doc = { }, to make sure all fields are initialized to zero. (The assignments below should fill in all the fields, but just to make sure, and in case any fields ever got added to the struct in the future.)

@snej
Copy link
Contributor

snej commented May 12, 2015

Thanks! Looks great except for the two issues with struct initialization.

Those are valid in C99, but in no C++ spec to date.
Use regular define/assign statements instead.
@jpetso
Copy link
Contributor Author

jpetso commented May 13, 2015

Good point. I had to check the C++ behaviour, but it seems this syntax will initialize the member variables with zeroes in both C and C++11. Updated the pull request, thanks for the review.

snej added a commit that referenced this pull request May 13, 2015
Fix various Linux/GCC build issues by being more standards conformant.
@snej snej merged commit d63edd7 into couchbaselabs:master May 13, 2015
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.

None yet

2 participants