Don't warn about functions not emitted

If a function is used by a template but this template is not
instantiated, the function will still be defined in the header
of a module but it won't be callable because it is in an anonymous
namespace and thus we get a warning.

This only happens in Clang; GCC consider functions referenced from
templates as used.

fixup! Don't warn about functions not emitted
This commit is contained in:
Roland Kaufmann 2013-09-19 10:59:41 +02:00
parent a7f32b934b
commit 244c867505
2 changed files with 6 additions and 2 deletions

View File

@ -40,6 +40,8 @@ namespace Opm
namespace
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
// Find the cells that are below and above a depth.
// TODO: add 'anitialiasing', obtaining a more precise split
// by f. ex. subdividing cells cut by the split depths.
@ -61,6 +63,7 @@ namespace Opm
}
}
}
#pragma clang diagnostic pop
enum WaterInit { WaterBelow, WaterAbove };

View File

@ -62,7 +62,8 @@ namespace
}
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
// Compute flux corresponding to a velocity vector v = v0 + x*v1.
void computeFluxLinear(const UnstructuredGrid& grid,
const std::vector<double>& v0,
@ -81,7 +82,7 @@ namespace
flux[face] = std::inner_product(v.begin(), v.end(), grid.face_normals + face*dim, 0.0);
}
}
#pragma clang diagnostic pop
double vectorDiff2(const std::vector<double>& v1, const std::vector<double>& v2)
{