BIND 10 #1773: build failure with clang++ on MacOS Lion
BIND 10 Development
do-not-reply at isc.org
Tue Apr 3 11:36:29 UTC 2012
#1773: build failure with clang++ on MacOS Lion
-------------------------------------+-------------------------------------
Reporter: | Owner: jinmei
jinmei | Status: reviewing
Type: | Milestone:
defect | Sprint-20120403
Priority: | Resolution:
medium | Sensitive: 0
Component: build | Sub-Project: Core
system | Estimated Difficulty: 2
Keywords: | Total Hours: 0
Defect Severity: N/A |
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by vorner):
* owner: vorner => jinmei
Comment:
Hello
First, should the `target_` be initilazed to `NULL` here?
{{{#!diff
BenchMark(const int iterations, T target) :
- iterations_(iterations), sub_iterations_(0), target_(target)
+ iterations_(iterations), sub_iterations_(0)
{
- initialize(true);
+ initialize(target, true);
}
}}}
Also, I'm not sure this is the correct fix. I guess this happened:
* The parameter of the constructor is `T`, not `T&` here.
* If left for autodetection, it may have happened gcc chose Type& as `T`
and clang++ only Type. Anyway, the `T` got expanded to the bare type.
* As such, the parameter is passed by copy allocated on the stack. The
reference should be taken from the parameter on the stack which is
obviously wrong, as the parameter ceases to exist soon.
I believe the correct fix in this case is not this workaround (because
then the copied parameter would be initialized instead of the correct one
anyway and it needs the type to be copy-constructible), but changing the
constructor to `T& target` instead of `T target`.
Also, did you notice the commit message has two [branch] tags?
--
Ticket URL: <http://bind10.isc.org/ticket/1773#comment:8>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list