Skip to content

Commit c894080

Browse files
committed
Silence warnings about unused parameters
Their names are useful to understand the purpose of the function and/or are part of Doxygen documentation, and thus cannot be removed.
1 parent 254b4d4 commit c894080

27 files changed

+110
-9
lines changed

jbmc/src/java_bytecode/character_refine_preprocess.cpp

+15
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
binary_relation_exprt is_bmp(chr, ID_le, from_integer(0xFFFF, chr.type()));
406409
return is_bmp;
407410
}
@@ -423,6 +426,7 @@ codet character_refine_preprocesst::convert_is_bmp_code_point(
423426
exprt character_refine_preprocesst::expr_of_is_defined(
424427
const exprt &chr, const typet &type)
425428
{
429+
(void)type; // unused parameter
426430
// The following intervals are undefined in unicode, according to
427431
// the Unicode Character Database: http://www.unicode.org/Public/UCD/latest/
428432
exprt::operandst intervals;
@@ -487,6 +491,7 @@ codet character_refine_preprocesst::convert_is_defined_int(
487491
exprt character_refine_preprocesst::expr_of_is_digit(
488492
const exprt &chr, const typet &type)
489493
{
494+
(void)type; // unused parameter
490495
exprt latin_digit=in_interval_expr(chr, '0', '9');
491496
exprt arabic_indic_digit=in_interval_expr(chr, 0x660, 0x669);
492497
exprt extended_digit=in_interval_expr(chr, 0x6F0, 0x6F9);
@@ -525,6 +530,7 @@ codet character_refine_preprocesst::convert_is_digit_int(
525530
exprt character_refine_preprocesst::expr_of_is_high_surrogate(
526531
const exprt &chr, const typet &type)
527532
{
533+
(void)type; // unused parameter
528534
return in_interval_expr(chr, 0xD800, 0xDBFF);
529535
}
530536

@@ -549,6 +555,7 @@ codet character_refine_preprocesst::convert_is_high_surrogate(
549555
exprt character_refine_preprocesst::expr_of_is_identifier_ignorable(
550556
const exprt &chr, const typet &type)
551557
{
558+
(void)type; // unused parameter
552559
or_exprt ignorable(
553560
in_interval_expr(chr, 0x0000, 0x0008),
554561
or_exprt(
@@ -776,6 +783,7 @@ codet character_refine_preprocesst::convert_is_low_surrogate(
776783
exprt character_refine_preprocesst::expr_of_is_mirrored(
777784
const exprt &chr, const typet &type)
778785
{
786+
(void)type; // unused parameter
779787
return in_list_expr(chr, {0x28, 0x29, 0x3C, 0x3E, 0x5B, 0x5D, 0x7B, 0x7D});
780788
}
781789

@@ -818,6 +826,7 @@ codet character_refine_preprocesst::convert_is_space(conversion_inputt &target)
818826
exprt character_refine_preprocesst::expr_of_is_space_char(
819827
const exprt &chr, const typet &type)
820828
{
829+
(void)type; // unused parameter
821830
std::list<mp_integer> space_characters=
822831
{0x20, 0x00A0, 0x1680, 0x202F, 0x205F, 0x3000, 0x2028, 0x2029};
823832
exprt condition0=in_list_expr(chr, space_characters);
@@ -852,6 +861,7 @@ codet character_refine_preprocesst::convert_is_space_char_int(
852861
exprt character_refine_preprocesst::expr_of_is_supplementary_code_point(
853862
const exprt &chr, const typet &type)
854863
{
864+
(void)type; // unused parameter
855865
return binary_relation_exprt(chr, ID_gt, from_integer(0xFFFF, chr.type()));
856866
}
857867

@@ -872,6 +882,7 @@ codet character_refine_preprocesst::convert_is_supplementary_code_point(
872882
exprt character_refine_preprocesst::expr_of_is_surrogate(
873883
const exprt &chr, const typet &type)
874884
{
885+
(void)type; // unused parameter
875886
return in_interval_expr(chr, 0xD800, 0xDFFF);
876887
}
877888

@@ -908,6 +919,7 @@ codet character_refine_preprocesst::convert_is_surrogate_pair(
908919
exprt character_refine_preprocesst::expr_of_is_title_case(
909920
const exprt &chr, const typet &type)
910921
{
922+
(void)type; // unused parameter
911923
std::list<mp_integer>title_case_chars=
912924
{0x01C5, 0x01C8, 0x01CB, 0x01F2, 0x1FBC, 0x1FCC, 0x1FFC};
913925
exprt::operandst conditions;
@@ -945,6 +957,7 @@ codet character_refine_preprocesst::convert_is_title_case_int(
945957
exprt character_refine_preprocesst::expr_of_is_letter_number(
946958
const exprt &chr, const typet &type)
947959
{
960+
(void)type; // unused parameter
948961
// The following set of characters is the general category "Nl" in the
949962
// Unicode specification.
950963
exprt cond0=in_interval_expr(chr, 0x16EE, 0x16F0);
@@ -1058,6 +1071,7 @@ codet character_refine_preprocesst::convert_is_upper_case_int(
10581071
exprt character_refine_preprocesst::expr_of_is_valid_code_point(
10591072
const exprt &chr, const typet &type)
10601073
{
1074+
(void)type; // unused parameter
10611075
return binary_relation_exprt(chr, ID_le, from_integer(0x10FFFF, chr.type()));
10621076
}
10631077

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

jbmc/src/java_bytecode/java_bytecode_concurrency_instrumentation.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ static void instrument_end_thread(
357357
const symbol_tablet &symbol_table)
358358
{
359359
PRECONDITION(f_code.arguments().size() == 1);
360+
(void)symbol_table; // unused parameter
360361

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

jbmc/src/java_bytecode/java_bytecode_language.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,12 @@ bool java_bytecode_languaget::to_expr(
11781178
java_bytecode_parser.clear();
11791179

11801180
return result;
1181+
#else
1182+
// unused parameters
1183+
(void)code;
1184+
(void)module;
1185+
(void)expr;
1186+
(void)ns;
11811187
#endif
11821188

11831189
return true; // fail for now

jbmc/src/java_bytecode/java_bytecode_typecheck.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ bool java_bytecode_typecheck(
119119
}
120120

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

124129
// fail for now

jbmc/src/java_bytecode/java_enum_static_init_unwind_handler.cpp

+2
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

+2
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,8 @@ static void merge_variable_table_entries(
538538
<< merge_into.var.name << "; new live range "
539539
<< merge_into.var.start_pc << '-'
540540
<< merge_into.var.start_pc + merge_into.var.length << '\n';
541+
#else
542+
(void)debug_out; // unused parameter
541543
#endif
542544

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

src/analyses/constant_propagator.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ bool constant_propagator_domaint::two_way_propagate_rec(
229229
{
230230
#ifdef DEBUG
231231
std::cout << "two_way_propagate_rec: " << format(expr) << '\n';
232+
#else
233+
(void)expr; // unused parameter
232234
#endif
233235

234236
bool change=false;
@@ -260,6 +262,8 @@ bool constant_propagator_domaint::two_way_propagate_rec(
260262
assign_rec(values, rhs, lhs, ns);
261263
change=values.meet(copy_values);
262264
}
265+
#else
266+
(void)cp; // unused parameter
263267
#endif
264268

265269
#ifdef DEBUG

src/analyses/local_may_alias.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ void local_may_aliast::build(const goto_functiont &goto_function)
328328

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

331+
(void)goto_function; // unused parameter
331332
#if 0
332333
// feed in sufficiently bad defaults
333334
for(code_typet::parameterst::const_iterator

src/analyses/uncaught_exceptions_analysis.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ void uncaught_exceptions_analysist::collect_uncaught_exceptions(
183183
void uncaught_exceptions_analysist::output(
184184
const goto_functionst &goto_functions) const
185185
{
186+
(void)goto_functions; // unused parameter
186187
#ifdef DEBUG
187188
forall_goto_functions(it, goto_functions)
188189
{

src/goto-analyzer/goto_analyzer_parse_options.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ bool goto_analyzer_parse_optionst::process_goto_program(
746746
// add generic checks
747747
status() << "Generic Property Instrumentation" << eom;
748748
goto_check(options, goto_model);
749+
#else
750+
(void)options; // unused parameter
749751
#endif
750752

751753
// recalculate numbers, etc.

src/goto-cc/hybrid_binary.cpp

+4
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

+4
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

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ void scratch_programt::append_loop(
186186
append(program);
187187

188188
// Update any back jumps to the loop header.
189+
(void)loop_header; // unused parameter
189190
assume(false_exprt());
190191

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

src/goto-instrument/cover_basic_blocks.h

+5-2
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

+2
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

+2
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/wmm/data_dp.cpp

+2
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
}

src/goto-instrument/wmm/instrumenter_strategies.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ void inline instrumentert::instrument_minimum_interference_inserter(
344344

345345
glp_delete_prob(lp);
346346
#else
347+
(void)set_of_cycles; // unused parameter
347348
throw "sorry, minimum interference option requires glpk; "
348349
"please recompile goto-instrument with glpk";
349350
#endif

src/goto-instrument/wmm/shared_buffers.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@ void shared_bufferst::flush_read(
266266

267267
assignment(goto_program, target, source_location, vars.read_delayed,
268268
false_exprt());
269+
#else
270+
// unused parameters
271+
(void)goto_program;
272+
(void)target;
273+
(void)target;
274+
(void)source_location;
275+
(void)write_object;
269276
#endif
270277

271278
/* option 2 */

src/goto-programs/osx_fat_reader.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ bool is_osx_fat_magic(char hdr[4])
2929
case FAT_CIGAM:
3030
return true;
3131
}
32+
#else
33+
(void)hdr; // unused parameter
3234
#endif
3335

3436
return false;
@@ -70,6 +72,8 @@ osx_fat_readert::osx_fat_readert(std::ifstream &in) :
7072
cpusubtype==CPU_SUBTYPE_HPPA_7100LC &&
7173
size > 0;
7274
}
75+
#else
76+
(void)in; // unused parameter
7377
#endif
7478
}
7579

src/langapi/language.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ irep_idt languaget::generate_opaque_stub_body(
115115
symbolt &symbol,
116116
symbol_tablet &symbol_table)
117117
{
118+
// unused parameters
119+
(void)symbol;
120+
(void)symbol_table;
118121
return ID_nil;
119122
}
120123

@@ -131,6 +134,10 @@ parameter_symbolt languaget::build_stub_parameter_symbol(
131134
size_t parameter_index,
132135
const code_typet::parametert &parameter)
133136
{
137+
// unused parameters
138+
(void)function_symbol;
139+
(void)parameter_index;
140+
(void)parameter;
134141
error() << "language " << id()
135142
<< " doesn't implement build_stub_parameter_symbol. "
136143
<< "This means cannot use opaque functions." << eom;

0 commit comments

Comments
 (0)