Skip to content

Silence warnings about unused parameters [blocks: #2310] #2470

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

Merged
merged 2 commits into from
Nov 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions jbmc/src/java_bytecode/character_refine_preprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ codet character_refine_preprocesst::convert_high_surrogate(
exprt character_refine_preprocesst::expr_of_is_ascii_lower_case(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
return in_interval_expr(chr, 'a', 'z');
}

Expand All @@ -348,6 +349,7 @@ exprt character_refine_preprocesst::expr_of_is_ascii_lower_case(
exprt character_refine_preprocesst::expr_of_is_ascii_upper_case(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
return in_interval_expr(chr, 'A', 'Z');
}

Expand Down Expand Up @@ -402,6 +404,7 @@ codet character_refine_preprocesst::convert_is_alphabetic(
exprt character_refine_preprocesst::expr_of_is_bmp_code_point(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
return and_exprt(
binary_relation_exprt(chr, ID_le, from_integer(0xFFFF, chr.type())),
binary_relation_exprt(chr, ID_ge, from_integer(0, chr.type())));
Expand All @@ -424,6 +427,7 @@ codet character_refine_preprocesst::convert_is_bmp_code_point(
exprt character_refine_preprocesst::expr_of_is_defined(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
// The following intervals are undefined in unicode, according to
// the Unicode Character Database: http://www.unicode.org/Public/UCD/latest/
exprt::operandst intervals;
Expand Down Expand Up @@ -488,6 +492,7 @@ codet character_refine_preprocesst::convert_is_defined_int(
exprt character_refine_preprocesst::expr_of_is_digit(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
exprt latin_digit=in_interval_expr(chr, '0', '9');
exprt arabic_indic_digit=in_interval_expr(chr, 0x660, 0x669);
exprt extended_digit=in_interval_expr(chr, 0x6F0, 0x6F9);
Expand Down Expand Up @@ -526,6 +531,7 @@ codet character_refine_preprocesst::convert_is_digit_int(
exprt character_refine_preprocesst::expr_of_is_high_surrogate(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
return in_interval_expr(chr, 0xD800, 0xDBFF);
}

Expand All @@ -550,6 +556,7 @@ codet character_refine_preprocesst::convert_is_high_surrogate(
exprt character_refine_preprocesst::expr_of_is_identifier_ignorable(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
or_exprt ignorable(
in_interval_expr(chr, 0x0000, 0x0008),
or_exprt(
Expand Down Expand Up @@ -777,6 +784,7 @@ codet character_refine_preprocesst::convert_is_low_surrogate(
exprt character_refine_preprocesst::expr_of_is_mirrored(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
return in_list_expr(chr, {0x28, 0x29, 0x3C, 0x3E, 0x5B, 0x5D, 0x7B, 0x7D});
}

Expand Down Expand Up @@ -819,6 +827,7 @@ codet character_refine_preprocesst::convert_is_space(conversion_inputt &target)
exprt character_refine_preprocesst::expr_of_is_space_char(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
std::list<mp_integer> space_characters=
{0x20, 0x00A0, 0x1680, 0x202F, 0x205F, 0x3000, 0x2028, 0x2029};
exprt condition0=in_list_expr(chr, space_characters);
Expand Down Expand Up @@ -853,6 +862,7 @@ codet character_refine_preprocesst::convert_is_space_char_int(
exprt character_refine_preprocesst::expr_of_is_supplementary_code_point(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
return binary_relation_exprt(chr, ID_gt, from_integer(0xFFFF, chr.type()));
}

Expand All @@ -873,6 +883,7 @@ codet character_refine_preprocesst::convert_is_supplementary_code_point(
exprt character_refine_preprocesst::expr_of_is_surrogate(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
return in_interval_expr(chr, 0xD800, 0xDFFF);
}

Expand Down Expand Up @@ -909,6 +920,7 @@ codet character_refine_preprocesst::convert_is_surrogate_pair(
exprt character_refine_preprocesst::expr_of_is_title_case(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
std::list<mp_integer>title_case_chars=
{0x01C5, 0x01C8, 0x01CB, 0x01F2, 0x1FBC, 0x1FCC, 0x1FFC};
exprt::operandst conditions;
Expand Down Expand Up @@ -946,6 +958,7 @@ codet character_refine_preprocesst::convert_is_title_case_int(
exprt character_refine_preprocesst::expr_of_is_letter_number(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
// The following set of characters is the general category "Nl" in the
// Unicode specification.
exprt cond0=in_interval_expr(chr, 0x16EE, 0x16F0);
Expand Down Expand Up @@ -1059,6 +1072,7 @@ codet character_refine_preprocesst::convert_is_upper_case_int(
exprt character_refine_preprocesst::expr_of_is_valid_code_point(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
return binary_relation_exprt(chr, ID_le, from_integer(0x10FFFF, chr.type()));
}

Expand All @@ -1083,6 +1097,7 @@ codet character_refine_preprocesst::convert_is_valid_code_point(
exprt character_refine_preprocesst::expr_of_is_whitespace(
const exprt &chr, const typet &type)
{
(void)type; // unused parameter
exprt::operandst conditions;
std::list<mp_integer> space_characters=
{0x20, 0x1680, 0x205F, 0x3000, 0x2028, 0x2029};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ static void instrument_end_thread(
const symbol_tablet &symbol_table)
{
PRECONDITION(f_code.arguments().size() == 1);
(void)symbol_table; // unused parameter

// Build id, used to construct appropriate labels.
// Note: java does not have labels so this should be safe
Expand Down
11 changes: 9 additions & 2 deletions jbmc/src/java_bytecode/java_bytecode_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ bool java_bytecode_languaget::to_expr(
exprt &expr,
const namespacet &ns)
{
#if 0
#if 0
expr.make_nil();

// no preprocessing yet...
Expand Down Expand Up @@ -1234,7 +1234,13 @@ bool java_bytecode_languaget::to_expr(
java_bytecode_parser.clear();

return result;
#endif
#else
// unused parameters
(void)code;
(void)module;
(void)expr;
(void)ns;
#endif

return true; // fail for now
}
Expand All @@ -1249,5 +1255,6 @@ java_bytecode_languaget::~java_bytecode_languaget()
std::vector<load_extra_methodst>
java_bytecode_languaget::build_extra_entry_points(const optionst &options) const
{
(void)options; // unused parameter
return {};
}
9 changes: 7 additions & 2 deletions jbmc/src/java_bytecode/java_bytecode_typecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool java_bytecode_typecheck(
message_handlert &message_handler,
const namespacet &ns)
{
#if 0
#if 0
symbol_tablet symbol_table;
java_bytecode_parse_treet java_bytecode_parse_tree;

Expand Down Expand Up @@ -119,7 +119,12 @@ bool java_bytecode_typecheck(
}

return java_bytecode_typecheck.get_error_found();
#endif
#else
// unused parameters
(void)expr;
(void)message_handler;
(void)ns;
#endif

// fail for now
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ tvt java_enum_static_init_unwind_handler(
unsigned &unwind_max,
const symbol_tablet &symbol_table)
{
(void)loop_number; // unused parameter

const irep_idt enum_function_id = find_enum_function_on_stack(context);
if(enum_function_id.empty())
return tvt::unknown();
Expand Down
2 changes: 2 additions & 0 deletions jbmc/src/java_bytecode/java_local_variable_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,8 @@ static void merge_variable_table_entries(
<< merge_into.var.name << "; new live range "
<< merge_into.var.start_pc << '-'
<< merge_into.var.start_pc + merge_into.var.length << '\n';
#else
(void)debug_out; // unused parameter
#endif

// Nuke the now-subsumed var-table entries:
Expand Down
4 changes: 4 additions & 0 deletions jbmc/src/java_bytecode/select_pointer_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pointer_typet select_pointer_typet::convert_pointer_type(
&generic_parameter_specialization_map,
const namespacet &ns) const
{
(void)ns; // unused parameter
// if we have a map of generic parameters -> types and the pointer is
// a generic parameter, specialize it with concrete types
if(!generic_parameter_specialization_map.empty())
Expand Down Expand Up @@ -229,5 +230,8 @@ std::set<symbol_typet> select_pointer_typet::get_parameter_alternative_types(
const irep_idt &parameter_name,
const namespacet &ns) const
{
// unused parameters
(void)function_name;
(void)parameter_name;
return {};
}
1 change: 1 addition & 0 deletions src/analyses/ai_domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class ai_domain_baset
/// return true if unchanged
virtual bool ai_simplify(exprt &condition, const namespacet &ns) const
{
(void)condition; // unused parameter
return true;
}

Expand Down
4 changes: 4 additions & 0 deletions src/analyses/constant_propagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ bool constant_propagator_domaint::two_way_propagate_rec(
{
#ifdef DEBUG
std::cout << "two_way_propagate_rec: " << format(expr) << '\n';
#else
(void)expr; // unused parameter
#endif

bool change=false;
Expand Down Expand Up @@ -268,6 +270,8 @@ bool constant_propagator_domaint::two_way_propagate_rec(
assign_rec(values, rhs, lhs, ns);
change = values.meet(copy_values, ns);
}
#else
(void)cp; // unused parameter
#endif

#ifdef DEBUG
Expand Down
9 changes: 5 additions & 4 deletions src/analyses/local_may_alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ void local_may_aliast::build(const goto_functiont &goto_function)

loc_infos.resize(cfg.nodes.size());

#if 0
(void)goto_function; // unused parameter
#if 0
// feed in sufficiently bad defaults
for(code_typet::parameterst::const_iterator
it=goto_function.type.parameters().begin();
Expand All @@ -340,9 +341,9 @@ void local_may_aliast::build(const goto_functiont &goto_function)
loc_infos[0].points_to[objects.number(identifier)].objects.insert(
unknown_object);
}
#endif
#endif

#if 0
#if 0
for(localst::locals_mapt::const_iterator
l_it=locals.locals_map.begin();
l_it!=locals.locals_map.end();
Expand All @@ -352,7 +353,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
loc_infos[0].aliases.make_union(
objects.number(l_it->second), unknown_object);
}
#endif
#endif

while(!work_queue.empty())
{
Expand Down
1 change: 1 addition & 0 deletions src/analyses/uncaught_exceptions_analysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ void uncaught_exceptions_analysist::collect_uncaught_exceptions(
void uncaught_exceptions_analysist::output(
const goto_functionst &goto_functions) const
{
(void)goto_functions; // unused parameter
#ifdef DEBUG
forall_goto_functions(it, goto_functions)
{
Expand Down
6 changes: 4 additions & 2 deletions src/goto-analyzer/goto_analyzer_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,11 +750,13 @@ bool goto_analyzer_parse_optionst::process_goto_program(
remove_vector(goto_model);
remove_complex(goto_model);

#if 0
#if 0
// add generic checks
status() << "Generic Property Instrumentation" << eom;
goto_check(options, goto_model);
#endif
#else
(void)options; // unused parameter
#endif

// recalculate numbers, etc.
goto_model.goto_functions.update();
Expand Down
4 changes: 4 additions & 0 deletions src/goto-cc/hybrid_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ int hybrid_binary(
}

#else
// unused parameters
(void)compiler_or_linker;
(void)goto_binary_file;
(void)output_file;
message.error() << "binary merging not implemented for this platform"
<< messaget::eom;
result = 1;
Expand Down
4 changes: 4 additions & 0 deletions src/goto-instrument/accelerate/polynomial_accelerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ bool polynomial_acceleratort::fit_const(
exprt &target,
polynomialt &poly)
{
// unused parameters
(void)body;
(void)target;
(void)poly;
return false;

#if 0
Expand Down
1 change: 1 addition & 0 deletions src/goto-instrument/accelerate/scratch_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ void scratch_programt::append_loop(
append(program);

// Update any back jumps to the loop header.
(void)loop_header; // unused parameter
assume(false_exprt());

goto_programt::targett end=add_instruction(SKIP);
Expand Down
7 changes: 5 additions & 2 deletions src/goto-instrument/cover_basic_blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Author: Daniel Kroening

#include <unordered_set>

#include <goto-programs/goto_model.h>
#include <util/message.h>

class message_handlert;
#include <goto-programs/goto_model.h>

class cover_blocks_baset
{
Expand Down Expand Up @@ -49,6 +49,9 @@ class cover_blocks_baset
const goto_programt &goto_program,
message_handlert &message_handler)
{
// unused parameters
(void)goto_program;
(void)message_handler;
}
};

Expand Down
2 changes: 2 additions & 0 deletions src/goto-instrument/cover_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ bool include_pattern_filtert::operator()(
const irep_idt &identifier,
const goto_functionst::goto_functiont &goto_function) const
{
(void)goto_function; // unused parameter
std::smatch string_matcher;
return std::regex_match(id2string(identifier), string_matcher, regex_matcher);
}
Expand All @@ -67,6 +68,7 @@ bool trivial_functions_filtert::operator()(
const irep_idt &identifier,
const goto_functionst::goto_functiont &goto_function) const
{
(void)identifier; // unused parameter
unsigned long count_assignments = 0, count_goto = 0;
forall_goto_program_instructions(i_it, goto_function.body)
{
Expand Down
2 changes: 2 additions & 0 deletions src/goto-instrument/full_slicer_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class full_slicert
{
#ifdef DEBUG_FULL_SLICERT
cfg[entry].required_by.insert(reason->location_number);
#else
(void)reason; // unused parameter
#endif
queue.push(entry);
}
Expand Down
5 changes: 4 additions & 1 deletion src/goto-instrument/rw_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ class rw_set_baset
void output(std::ostream &out) const;

protected:
virtual void track_deref(const entryt &, bool read) {}
virtual void track_deref(const entryt &, bool read)
{
(void)read; // unused parameter
}
virtual void set_track_deref() {}
virtual void reset_track_deref() {}

Expand Down
2 changes: 2 additions & 0 deletions src/goto-instrument/wmm/data_dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,7 @@ void data_dpt::print(messaget &message)
for(l_it=m_it->second.begin(); l_it!=m_it->second.end(); ++l_it)
message.debug()<< "loc: "<<*l_it << messaget::eom;
}
#else
(void)message; // unused parameter
#endif
}
Loading