Skip to content

Commit 96a71f6

Browse files
authored
Merge pull request #2470 from tautschnig/vs-void-par
Silence warnings about unused parameters [blocks: #2310]
2 parents 18328db + 359b3b1 commit 96a71f6

30 files changed

+188
-80
lines changed

jbmc/src/java_bytecode/character_refine_preprocess.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ codet character_refine_preprocesst::convert_high_surrogate(
338338
exprt character_refine_preprocesst::expr_of_is_ascii_lower_case(
339339
const exprt &chr, const typet &type)
340340
{
341+
(void)type; // unused parameter
341342
return in_interval_expr(chr, 'a', 'z');
342343
}
343344

@@ -348,6 +349,7 @@ exprt character_refine_preprocesst::expr_of_is_ascii_lower_case(
348349
exprt character_refine_preprocesst::expr_of_is_ascii_upper_case(
349350
const exprt &chr, const typet &type)
350351
{
352+
(void)type; // unused parameter
351353
return in_interval_expr(chr, 'A', 'Z');
352354
}
353355

@@ -402,6 +404,7 @@ codet character_refine_preprocesst::convert_is_alphabetic(
402404
exprt character_refine_preprocesst::expr_of_is_bmp_code_point(
403405
const exprt &chr, const typet &type)
404406
{
407+
(void)type; // unused parameter
405408
return and_exprt(
406409
binary_relation_exprt(chr, ID_le, from_integer(0xFFFF, chr.type())),
407410
binary_relation_exprt(chr, ID_ge, from_integer(0, chr.type())));
@@ -424,6 +427,7 @@ codet character_refine_preprocesst::convert_is_bmp_code_point(
424427
exprt character_refine_preprocesst::expr_of_is_defined(
425428
const exprt &chr, const typet &type)
426429
{
430+
(void)type; // unused parameter
427431
// The following intervals are undefined in unicode, according to
428432
// the Unicode Character Database: http://www.unicode.org/Public/UCD/latest/
429433
exprt::operandst intervals;
@@ -488,6 +492,7 @@ codet character_refine_preprocesst::convert_is_defined_int(
488492
exprt character_refine_preprocesst::expr_of_is_digit(
489493
const exprt &chr, const typet &type)
490494
{
495+
(void)type; // unused parameter
491496
exprt latin_digit=in_interval_expr(chr, '0', '9');
492497
exprt arabic_indic_digit=in_interval_expr(chr, 0x660, 0x669);
493498
exprt extended_digit=in_interval_expr(chr, 0x6F0, 0x6F9);
@@ -526,6 +531,7 @@ codet character_refine_preprocesst::convert_is_digit_int(
526531
exprt character_refine_preprocesst::expr_of_is_high_surrogate(
527532
const exprt &chr, const typet &type)
528533
{
534+
(void)type; // unused parameter
529535
return in_interval_expr(chr, 0xD800, 0xDBFF);
530536
}
531537

@@ -550,6 +556,7 @@ codet character_refine_preprocesst::convert_is_high_surrogate(
550556
exprt character_refine_preprocesst::expr_of_is_identifier_ignorable(
551557
const exprt &chr, const typet &type)
552558
{
559+
(void)type; // unused parameter
553560
or_exprt ignorable(
554561
in_interval_expr(chr, 0x0000, 0x0008),
555562
or_exprt(
@@ -777,6 +784,7 @@ codet character_refine_preprocesst::convert_is_low_surrogate(
777784
exprt character_refine_preprocesst::expr_of_is_mirrored(
778785
const exprt &chr, const typet &type)
779786
{
787+
(void)type; // unused parameter
780788
return in_list_expr(chr, {0x28, 0x29, 0x3C, 0x3E, 0x5B, 0x5D, 0x7B, 0x7D});
781789
}
782790

@@ -819,6 +827,7 @@ codet character_refine_preprocesst::convert_is_space(conversion_inputt &target)
819827
exprt character_refine_preprocesst::expr_of_is_space_char(
820828
const exprt &chr, const typet &type)
821829
{
830+
(void)type; // unused parameter
822831
std::list<mp_integer> space_characters=
823832
{0x20, 0x00A0, 0x1680, 0x202F, 0x205F, 0x3000, 0x2028, 0x2029};
824833
exprt condition0=in_list_expr(chr, space_characters);
@@ -853,6 +862,7 @@ codet character_refine_preprocesst::convert_is_space_char_int(
853862
exprt character_refine_preprocesst::expr_of_is_supplementary_code_point(
854863
const exprt &chr, const typet &type)
855864
{
865+
(void)type; // unused parameter
856866
return binary_relation_exprt(chr, ID_gt, from_integer(0xFFFF, chr.type()));
857867
}
858868

@@ -873,6 +883,7 @@ codet character_refine_preprocesst::convert_is_supplementary_code_point(
873883
exprt character_refine_preprocesst::expr_of_is_surrogate(
874884
const exprt &chr, const typet &type)
875885
{
886+
(void)type; // unused parameter
876887
return in_interval_expr(chr, 0xD800, 0xDFFF);
877888
}
878889

@@ -909,6 +920,7 @@ codet character_refine_preprocesst::convert_is_surrogate_pair(
909920
exprt character_refine_preprocesst::expr_of_is_title_case(
910921
const exprt &chr, const typet &type)
911922
{
923+
(void)type; // unused parameter
912924
std::list<mp_integer>title_case_chars=
913925
{0x01C5, 0x01C8, 0x01CB, 0x01F2, 0x1FBC, 0x1FCC, 0x1FFC};
914926
exprt::operandst conditions;
@@ -946,6 +958,7 @@ codet character_refine_preprocesst::convert_is_title_case_int(
946958
exprt character_refine_preprocesst::expr_of_is_letter_number(
947959
const exprt &chr, const typet &type)
948960
{
961+
(void)type; // unused parameter
949962
// The following set of characters is the general category "Nl" in the
950963
// Unicode specification.
951964
exprt cond0=in_interval_expr(chr, 0x16EE, 0x16F0);
@@ -1059,6 +1072,7 @@ codet character_refine_preprocesst::convert_is_upper_case_int(
10591072
exprt character_refine_preprocesst::expr_of_is_valid_code_point(
10601073
const exprt &chr, const typet &type)
10611074
{
1075+
(void)type; // unused parameter
10621076
return binary_relation_exprt(chr, ID_le, from_integer(0x10FFFF, chr.type()));
10631077
}
10641078

@@ -1083,6 +1097,7 @@ codet character_refine_preprocesst::convert_is_valid_code_point(
10831097
exprt character_refine_preprocesst::expr_of_is_whitespace(
10841098
const exprt &chr, const typet &type)
10851099
{
1100+
(void)type; // unused parameter
10861101
exprt::operandst conditions;
10871102
std::list<mp_integer> space_characters=
10881103
{0x20, 0x1680, 0x205F, 0x3000, 0x2028, 0x2029};

jbmc/src/java_bytecode/java_bytecode_concurrency_instrumentation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ static void instrument_end_thread(
342342
const symbol_tablet &symbol_table)
343343
{
344344
PRECONDITION(f_code.arguments().size() == 1);
345+
(void)symbol_table; // unused parameter
345346

346347
// Build id, used to construct appropriate labels.
347348
// Note: java does not have labels so this should be safe

jbmc/src/java_bytecode/java_bytecode_language.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ bool java_bytecode_languaget::to_expr(
11981198
exprt &expr,
11991199
const namespacet &ns)
12001200
{
1201-
#if 0
1201+
#if 0
12021202
expr.make_nil();
12031203

12041204
// no preprocessing yet...
@@ -1234,7 +1234,13 @@ bool java_bytecode_languaget::to_expr(
12341234
java_bytecode_parser.clear();
12351235

12361236
return result;
1237-
#endif
1237+
#else
1238+
// unused parameters
1239+
(void)code;
1240+
(void)module;
1241+
(void)expr;
1242+
(void)ns;
1243+
#endif
12381244

12391245
return true; // fail for now
12401246
}
@@ -1249,5 +1255,6 @@ java_bytecode_languaget::~java_bytecode_languaget()
12491255
std::vector<load_extra_methodst>
12501256
java_bytecode_languaget::build_extra_entry_points(const optionst &options) const
12511257
{
1258+
(void)options; // unused parameter
12521259
return {};
12531260
}

jbmc/src/java_bytecode/java_bytecode_typecheck.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ bool java_bytecode_typecheck(
9090
message_handlert &message_handler,
9191
const namespacet &ns)
9292
{
93-
#if 0
93+
#if 0
9494
symbol_tablet symbol_table;
9595
java_bytecode_parse_treet java_bytecode_parse_tree;
9696

@@ -119,7 +119,12 @@ bool java_bytecode_typecheck(
119119
}
120120

121121
return java_bytecode_typecheck.get_error_found();
122-
#endif
122+
#else
123+
// unused parameters
124+
(void)expr;
125+
(void)message_handler;
126+
(void)ns;
127+
#endif
123128

124129
// fail for now
125130
return true;

jbmc/src/java_bytecode/java_enum_static_init_unwind_handler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ tvt java_enum_static_init_unwind_handler(
7070
unsigned &unwind_max,
7171
const symbol_tablet &symbol_table)
7272
{
73+
(void)loop_number; // unused parameter
74+
7375
const irep_idt enum_function_id = find_enum_function_on_stack(context);
7476
if(enum_function_id.empty())
7577
return tvt::unknown();

jbmc/src/java_bytecode/java_local_variable_table.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ static void merge_variable_table_entries(
549549
<< merge_into.var.name << "; new live range "
550550
<< merge_into.var.start_pc << '-'
551551
<< merge_into.var.start_pc + merge_into.var.length << '\n';
552+
#else
553+
(void)debug_out; // unused parameter
552554
#endif
553555

554556
// Nuke the now-subsumed var-table entries:

jbmc/src/java_bytecode/select_pointer_type.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pointer_typet select_pointer_typet::convert_pointer_type(
2929
&generic_parameter_specialization_map,
3030
const namespacet &ns) const
3131
{
32+
(void)ns; // unused parameter
3233
// if we have a map of generic parameters -> types and the pointer is
3334
// a generic parameter, specialize it with concrete types
3435
if(!generic_parameter_specialization_map.empty())
@@ -229,5 +230,8 @@ std::set<symbol_typet> select_pointer_typet::get_parameter_alternative_types(
229230
const irep_idt &parameter_name,
230231
const namespacet &ns) const
231232
{
233+
// unused parameters
234+
(void)function_name;
235+
(void)parameter_name;
232236
return {};
233237
}

src/analyses/ai_domain.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ class ai_domain_baset
104104
/// return true if unchanged
105105
virtual bool ai_simplify(exprt &condition, const namespacet &ns) const
106106
{
107+
(void)condition; // unused parameter
107108
return true;
108109
}
109110

src/analyses/constant_propagator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ bool constant_propagator_domaint::two_way_propagate_rec(
237237
{
238238
#ifdef DEBUG
239239
std::cout << "two_way_propagate_rec: " << format(expr) << '\n';
240+
#else
241+
(void)expr; // unused parameter
240242
#endif
241243

242244
bool change=false;
@@ -268,6 +270,8 @@ bool constant_propagator_domaint::two_way_propagate_rec(
268270
assign_rec(values, rhs, lhs, ns);
269271
change = values.meet(copy_values, ns);
270272
}
273+
#else
274+
(void)cp; // unused parameter
271275
#endif
272276

273277
#ifdef DEBUG

src/analyses/local_may_alias.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ void local_may_aliast::build(const goto_functiont &goto_function)
328328

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

331-
#if 0
331+
(void)goto_function; // unused parameter
332+
#if 0
332333
// feed in sufficiently bad defaults
333334
for(code_typet::parameterst::const_iterator
334335
it=goto_function.type.parameters().begin();
@@ -340,9 +341,9 @@ void local_may_aliast::build(const goto_functiont &goto_function)
340341
loc_infos[0].points_to[objects.number(identifier)].objects.insert(
341342
unknown_object);
342343
}
343-
#endif
344+
#endif
344345

345-
#if 0
346+
#if 0
346347
for(localst::locals_mapt::const_iterator
347348
l_it=locals.locals_map.begin();
348349
l_it!=locals.locals_map.end();
@@ -352,7 +353,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
352353
loc_infos[0].aliases.make_union(
353354
objects.number(l_it->second), unknown_object);
354355
}
355-
#endif
356+
#endif
356357

357358
while(!work_queue.empty())
358359
{

src/analyses/uncaught_exceptions_analysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ void uncaught_exceptions_analysist::collect_uncaught_exceptions(
182182
void uncaught_exceptions_analysist::output(
183183
const goto_functionst &goto_functions) const
184184
{
185+
(void)goto_functions; // unused parameter
185186
#ifdef DEBUG
186187
forall_goto_functions(it, goto_functions)
187188
{

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,13 @@ bool goto_analyzer_parse_optionst::process_goto_program(
750750
remove_vector(goto_model);
751751
remove_complex(goto_model);
752752

753-
#if 0
753+
#if 0
754754
// add generic checks
755755
status() << "Generic Property Instrumentation" << eom;
756756
goto_check(options, goto_model);
757-
#endif
757+
#else
758+
(void)options; // unused parameter
759+
#endif
758760

759761
// recalculate numbers, etc.
760762
goto_model.goto_functions.update();

src/goto-cc/hybrid_binary.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ int hybrid_binary(
9393
}
9494

9595
#else
96+
// unused parameters
97+
(void)compiler_or_linker;
98+
(void)goto_binary_file;
99+
(void)output_file;
96100
message.error() << "binary merging not implemented for this platform"
97101
<< messaget::eom;
98102
result = 1;

src/goto-instrument/accelerate/polynomial_accelerator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,10 @@ bool polynomial_acceleratort::fit_const(
450450
exprt &target,
451451
polynomialt &poly)
452452
{
453+
// unused parameters
454+
(void)body;
455+
(void)target;
456+
(void)poly;
453457
return false;
454458

455459
#if 0

src/goto-instrument/accelerate/scratch_program.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ void scratch_programt::append_loop(
185185
append(program);
186186

187187
// Update any back jumps to the loop header.
188+
(void)loop_header; // unused parameter
188189
assume(false_exprt());
189190

190191
goto_programt::targett end=add_instruction(SKIP);

src/goto-instrument/cover_basic_blocks.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Author: Daniel Kroening
1414

1515
#include <unordered_set>
1616

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

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

2121
class cover_blocks_baset
2222
{
@@ -49,6 +49,9 @@ class cover_blocks_baset
4949
const goto_programt &goto_program,
5050
message_handlert &message_handler)
5151
{
52+
// unused parameters
53+
(void)goto_program;
54+
(void)message_handler;
5255
}
5356
};
5457

src/goto-instrument/cover_filter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ bool include_pattern_filtert::operator()(
5151
const irep_idt &identifier,
5252
const goto_functionst::goto_functiont &goto_function) const
5353
{
54+
(void)goto_function; // unused parameter
5455
std::smatch string_matcher;
5556
return std::regex_match(id2string(identifier), string_matcher, regex_matcher);
5657
}
@@ -67,6 +68,7 @@ bool trivial_functions_filtert::operator()(
6768
const irep_idt &identifier,
6869
const goto_functionst::goto_functiont &goto_function) const
6970
{
71+
(void)identifier; // unused parameter
7072
unsigned long count_assignments = 0, count_goto = 0;
7173
forall_goto_program_instructions(i_it, goto_function.body)
7274
{

src/goto-instrument/full_slicer_class.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class full_slicert
9999
{
100100
#ifdef DEBUG_FULL_SLICERT
101101
cfg[entry].required_by.insert(reason->location_number);
102+
#else
103+
(void)reason; // unused parameter
102104
#endif
103105
queue.push(entry);
104106
}

src/goto-instrument/rw_set.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ class rw_set_baset
8787
void output(std::ostream &out) const;
8888

8989
protected:
90-
virtual void track_deref(const entryt &, bool read) {}
90+
virtual void track_deref(const entryt &, bool read)
91+
{
92+
(void)read; // unused parameter
93+
}
9194
virtual void set_track_deref() {}
9295
virtual void reset_track_deref() {}
9396

src/goto-instrument/wmm/data_dp.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,7 @@ void data_dpt::print(messaget &message)
185185
for(l_it=m_it->second.begin(); l_it!=m_it->second.end(); ++l_it)
186186
message.debug()<< "loc: "<<*l_it << messaget::eom;
187187
}
188+
#else
189+
(void)message; // unused parameter
188190
#endif
189191
}

0 commit comments

Comments
 (0)