Commit 2039f071 authored by Ben Huber's avatar Ben Huber

silenced faulty gcc warnings (closes #212); fixed faulty output of callstack...

silenced faulty gcc warnings (closes #212); fixed faulty output of callstack if function names are not available
parent 7defdcc1
Pipeline #1090 passed with stages
in 15 minutes and 41 seconds
......@@ -391,11 +391,14 @@ namespace xerus {
for (size_t i = numLeaves - 1; i < 2*numLeaves-1; ++i, ++dim_counter) {
if (dim_counter == numLeaves)
dim_counter = 0;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
if(isOperator) {
result.set_component(i, Tensor::dirac({1, result.dimensions[dim_counter], result.dimensions[numLeaves+dim_counter]}, _position[dim_counter]*result.dimensions[numLeaves+dim_counter] + _position[numLeaves+dim_counter]));
} else {
result.set_component(i, Tensor::dirac({1, result.dimensions[dim_counter]}, _position[dim_counter]));
}
#pragma GCC diagnostic pop
}
return result;
}
......@@ -1091,7 +1094,10 @@ namespace xerus {
internal::HTStack<isOperator>* stackOther;
if(moveOther && (stackOther = dynamic_cast<internal::HTStack<isOperator>*>(moveOther->tensorObject))) {
htOther = HTNetwork(*stackOther);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
INTERNAL_CHECK(htOther.dimensions == stackOther->dimensions, "Ie");
#pragma GCC diagnostic pop
} else { // Other is normal
INTERNAL_CHECK(dynamic_cast<const HTNetwork<isOperator>*>(_other.tensorObjectReadOnly),"Non-moveable HTStack (or other error) detected.");
htOther = *static_cast<const HTNetwork<isOperator>*>(_other.tensorObjectReadOnly);
......
......@@ -390,7 +390,7 @@ namespace xerus {
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sparse => Sparse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
else if(_base.tensorObjectReadOnly->is_sparse()) {
#define VLA(T, name) auto name##_store = xerus::misc::make_unique_array(new T); const auto & (name) = name##_store.get();
#define VLA(T, name) auto name##_store = xerus::misc::make_unique_array(new T); const auto & name = name##_store.get();
VLA(bool[_base.indices.size()] , fixedFlags); // Flag for each index indicating whether the index is fixed
VLA(bool[_base.indices.size()] , traceFlags); // Flag for each index indicating whether the index is part of a trace
VLA(size_t[_base.indices.size()], attributes); // Either the factor in _out, the value of an fixed index or the position of the other part of a trace
......
......@@ -144,7 +144,7 @@ namespace xerus { namespace misc { namespace internal {
continue;
}
res << ' ' << section->name;
if ((section->flags | SEC_CODE) == 0u) {
if ((section->flags & SEC_CODE) == 0u) {
return res.str()+"] <non executable address>";
}
// get more info on legal addresses
......
......@@ -270,11 +270,14 @@ namespace xerus {
TTNetwork<isOperator> result(_dimensions);
for (size_t i = 0; i < numComponents; ++i) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
if(isOperator) {
result.set_component(i, Tensor::dirac({1, result.dimensions[i], result.dimensions[numComponents+i], 1}, _position[i]*result.dimensions[numComponents+i] + _position[numComponents+i]));
} else {
result.set_component(i, Tensor::dirac({1, result.dimensions[i], 1}, _position[i]));
}
#pragma GCC diagnostic pop
}
return result;
}
......@@ -1054,7 +1057,10 @@ namespace xerus {
internal::TTStack<isOperator>* stackOther;
if(moveOther && (stackOther = dynamic_cast<internal::TTStack<isOperator>*>(moveOther->tensorObject))) {
ttOther = TTNetwork(*stackOther);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
INTERNAL_CHECK(ttOther.dimensions == stackOther->dimensions, "Ie");
#pragma GCC diagnostic pop
} else { // Other is normal
INTERNAL_CHECK(dynamic_cast<const TTNetwork<isOperator>*>(_other.tensorObjectReadOnly),"Non-moveable TTStack (or other error) detected.");
ttOther = *static_cast<const TTNetwork<isOperator>*>(_other.tensorObjectReadOnly);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment