-
Notifications
You must be signed in to change notification settings - Fork 138
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
Exception/Terminate warnings when building on Debian 9 / gcc 6.3 #134
Comments
What version of gcc are you compiling with, @mundoEarth ? |
And what version of gearmand are you compiling? |
@esabol, what do you mean "gcc"? Where can I found that? |
Those are just warnings though. They should definitely be addressed, but gearmand still builds. I used this Dockerfile to build from the 1.1.17 tarball:
The build completes fine and gearmand works fine. So I'm going to go ahead and change the bug title to "Exception warnings on Debian 9 (gcc 6.3.0)" BTW, the simplest way to find out things like compiler version and build settings in general is to upload the 'config.log' file from your build tree. |
btw a text example:
|
@SpamapS, your output shows them as warnings, but @mundoEarth's output shows them as errors. I think there's still some difference here that we haven't quite gotten to the bottom of. @mundoEarth, can you type |
index c67bc33..13ec630 100644
--- a/libtest/comparison.hpp
+++ b/libtest/comparison.hpp
@@ -93,17 +93,6 @@ bool _compare(const char *file, int line, const char *func, const T1_comparable&
template <class T1_comparable, class T2_comparable>
bool _compare_strcmp(const char *file, int line, const char *func, const T1_comparable& __expected, const T2_comparable& __actual)
{
- if (__expected == NULL)
- {
- FATAL("Expected value was NULL, programmer error");
- }
-
- if (__actual == NULL)
- {
- libtest::stream::make_cerr(file, line, func) << "Expected " << __expected << " but got NULL";
- return false;
- }
-
if (strncmp(__expected, __actual, strlen(__expected)))
{
libtest::stream::make_cerr(file, line, func) << "Expected " << __expected << " passed \"" << __actual << "\""; Build exception is the reason for the patch:
|
I've reproduced that behavior. What is failing part is Partial and quick solution is to check all errors and comment them out. The right solution would be to check if we need to throw error from object's destructor, being able to avoid that kind of errors. On my way to solve those. Not yet successfully compiled on Debian 9.0. @SpamapS, @p-alik, @BrianAker , see: https://akrzemi1.wordpress.com/2011/09/21/destructors-that-throw/ |
I found the solution. I successfully fired make. But that does not close a single issue which will bug us as Gearman is C/C++ project. It is compiler compabilities. Unless we state it clearly and explicitly, such issues may happen, or even worse - some folks may want to compile some version of gearman with older compiler version, having the newest source code version. Being compliant to specific version is important (I don't think we should stay compliant to C99 standard), but user/admin/developer knowing it earlier may easily find the version that will suit his OS and compiler. There are also some stuff in code that seems like legacy or trying to make C++ project stay compliant with C compiler. I think it could be compared to half naked man standing in the middle of Manhattan. Noone knows if he is sane. It causes lot of commotion. People are not sure how to behave. |
1. Fixes some NULL comparisons issue. 2. Fixes bad practice - throwing Exception from destructor. 3. It does not solve all issues with C++11 code compliance. 4. Tested on Virtual Machine with Debian 9.0 installed.
Now there should be some of these are addressed in master. Things in 'libtest/comparison.hpp' should be handled. |
I think this issue can be closed, right? |
Hi..
I need some help I got an error upon executing command "make" in debian 9..
![gearman libtest error](https://user-images.githubusercontent.com/16550247/28728184-8826ad5c-737c-11e7-862c-8b44648d0ec5.PNG)
below is the screenshot of the error :
The text was updated successfully, but these errors were encountered: