-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Math] GSLMultiRootFinder: Fix return pointer to local address #613
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
Conversation
|
Starting build on |
| const char * GSLMultiRootFinder::Name() const { | ||
| // get GSL name | ||
| return (fSolver != 0) ? fSolver->Name().c_str() : ""; | ||
| return (fSolver != 0) ? fSolver->Name().c_str() : nullptr; |
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.
That should not be needed? That address actually has static storage duration as per [lex.string]. Are you sure you're solving a problem in the current code version? (Note that we had a problem here because fSolver->Name() returned a std::string; it now returns a std::string&.)
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.
The compiler is complaining about it, so it could be a problem. I just noticed that the problem is not about the empty string, though, but about fSolver->Name().c_str(). So, in hindsight, while my "fix" is probably pointless, it does seem like the issue with returning a local address still remains.
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.
The problem of fSolver->Name()->c_str() should have been fixed by my commit of yesterday.
Strange the compiler is still complaining. Which version ?
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.
It's GCC 7 complaining. The warning in CDash can be found here.
|
Right, it says: (And why can I not link to a warning in CDash?) It was actually fixed today by (Yes, the log didn't really help in finding that commit...) |
|
Ok, indeed I don't see this on master anymore. Closing. |
No description provided.