Commit 67289a76 authored by Jürg Billeter's avatar Jürg Billeter

Do not warn when internal member is unused with --internal-header

Fixes bug 613035.
parent e5f2c5b1
......@@ -131,7 +131,11 @@ public class Vala.FlowAnalyzer : CodeVisitor {
public override void visit_field (Field f) {
if (f.is_internal_symbol () && !f.used) {
Report.warning (f.source_reference, "field `%s' never used".printf (f.get_full_name ()));
if (!f.is_private_symbol () && context.internal_header_filename != null) {
// do not warn if internal member may be used outside this compilation unit
} else {
Report.warning (f.source_reference, "field `%s' never used".printf (f.get_full_name ()));
}
}
}
......@@ -158,7 +162,11 @@ public class Vala.FlowAnalyzer : CodeVisitor {
if (m.is_internal_symbol () && !m.used && !m.entry_point
&& !m.overrides && (m.base_interface_method == null || m.base_interface_method == m)
&& !(m is CreationMethod)) {
Report.warning (m.source_reference, "method `%s' never used".printf (m.get_full_name ()));
if (!m.is_private_symbol () && context.internal_header_filename != null) {
// do not warn if internal member may be used outside this compilation unit
} else {
Report.warning (m.source_reference, "method `%s' never used".printf (m.get_full_name ()));
}
}
if (m.body == null) {
......
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