This repository has been archived by the owner on Mar 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 489
Cppfixes 201704 #309
Merged
Merged
Cppfixes 201704 #309
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
eb02361
Making three changes to fix compilation in our environment.
msjarrett 6a3b969
Adding comment to warn of the potential segfault in gcc.
msjarrett bdbdcc0
Renaming "temp" to "proxy_handle" to make more readable.
msjarrett c73950e
Swap the README.md change for a CONTRIBUTORS file for attribution.
msjarrett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,11 +156,11 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha | |
|
||
#define DJINNI_ASSERT_MSG(check, env, message) \ | ||
do { \ | ||
djinni::jniExceptionCheck(env); \ | ||
::djinni::jniExceptionCheck(env); \ | ||
const bool check__res = bool(check); \ | ||
djinni::jniExceptionCheck(env); \ | ||
::djinni::jniExceptionCheck(env); \ | ||
if (!check__res) { \ | ||
djinni::jniThrowAssertionError(env, __FILE__, __LINE__, message); \ | ||
::djinni::jniThrowAssertionError(env, __FILE__, __LINE__, message); \ | ||
} \ | ||
} while(false) | ||
#define DJINNI_ASSERT(check, env) DJINNI_ASSERT_MSG(check, env, #check) | ||
|
@@ -340,7 +340,10 @@ template <class T> | |
static const std::shared_ptr<T> & objectFromHandleAddress(jlong handle) { | ||
assert(handle); | ||
assert(handle > 4096); | ||
const auto & ret = reinterpret_cast<const CppProxyHandle<T> *>(handle)->get(); | ||
// Below line segfaults gcc-4.8. Using a temporary variable hides the bug. | ||
//const auto & ret = reinterpret_cast<const CppProxyHandle<T> *>(handle)->get(); | ||
const CppProxyHandle<T> *temp = reinterpret_cast<const CppProxyHandle<T> *>(handle); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Name this "proxy_handle" or something more descriptive? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
const auto & ret = temp->get(); | ||
assert(ret); | ||
return ret; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include <functional> | ||
#include <typeindex> | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@msjarrett can you explain this addition please? I assume you're at Google, so I'd guess this isn't inaccurate, but it's far from complete since we haven't made a habit of calling out all individual people/companies which contribute in the past.
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.
Our OSS policy asks us to add the company to the list of contributors, but as you mentioned, there isn't really a complete list in this project. The readme seems like the wrong place, but it'd be even weirder for me to create a new authors file for it.
Any suggestion for a better place for this?
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.
Hmm, yeah, maybe we should think about having an official list. This is the first time someone's raised the issue of a policy like this. Is the policy "you must add to the list" or can it be interpreted as "add to the list if it exists"? It seems like in our current state our "contributors list" is
git log
, and I don't know if there are global norms on GitHub about doing otherwise.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.
Is this coming from this policy: https://opensource.google.com/docs/patching/#how-to-patch
If so, that seems to suggest "If copyright authors are listed in a LICENSE, COPYING, AUTHORS", which wouldn't apply here. We could work on changing that if you'd like, but may not need to delay this diff on it.
It may be that the current list of "Authors" is poorly labeled/named. It's a list of "primary" contributors, not all contributors. We've used it as a way to recognize people who wrote large chunks of the tool, or whole new features. It's not intended to be a claim of copyright, since the whole project is copyrighted by Dropbox, per the CLA.
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.
Yes, the above link is the basis of the policy. I can see how it could be interpreted either way, but my compliance team is insisting it applies for this particular change.
Is there somewhere I could put this that would be more suitable?
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.
Hmm, the consensus in the Dropbox open-source team is the opposite. "If copyright authors are listed in a LICENSE, COPYING, AUTHORS or similar file" evaluates to false, so no action is required. The only place our contributors are listed is in git history, which will be attributed when I merge this. Can you possibly put your compliance team in touch with us? Do you know if it's the Authors list which is at issue here, or do they think the addition is required even if it's the first one.
Anyhow, I'd rather not let legal wrangling actually get in the way of a good contribution. I'd be open to possibly adding a CONTRIBUTORS file, with a paragraph at the top explaining it's not intended to be complete (the complete list being the git history), but only present where required for legal purposes. I'd also be open to clarifying/renaming the Authors section in the README to make it clear it's a way of acknowledging "top contributors" not a list of all contributors.
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.
Swapped the README.md change for a CONTRIBUTORS file. Does this work?