Skip to content

Commit 7e24dca

Browse files
author
Daniel Kroening
authored
Merge pull request #723 from reuk/extra-errors
Fix really pedantic compiler errors
2 parents 565faaf + 6755ecf commit 7e24dca

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

src/analyses/reaching_definitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class rd_range_domaint:public ai_domain_baset
160160
typedef std::map<locationt, rangest> ranges_at_loct;
161161

162162
const ranges_at_loct &get(const irep_idt &identifier) const;
163-
const void clear_cache(const irep_idt &identifier) const
163+
void clear_cache(const irep_idt &identifier) const
164164
{
165165
export_cache[identifier].clear();
166166
}

src/java_bytecode/bytecode_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,5 +218,5 @@ struct bytecode_infot const bytecode_info[]=
218218
{ "impdep1", 0xfe, ' ', 0, 0, ' ' }, // ; reserved for implementation-dependent operations within debuggers; should not appear in any class file NOLINT(*)
219219
{ "impdep2", 0xff, ' ', 0, 0, ' ' }, // ; reserved for implementation-dependent operations within debuggers; should not appear in any class file NOLINT(*)
220220
{ "wide", 0xc4, ' ', 0, 0, ' ' }, // modifier for others NOLINT(*)
221-
{ 0, 0 }
221+
{ nullptr, 0x00, '\0',0, 0, '\0'}, // zero-initialized NOLINT (*)
222222
};

src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,8 @@ codet java_bytecode_convert_methodt::convert_instructions(
23012301
// First create a simple flat list of basic blocks. We'll add lexical nesting
23022302
// constructs as variable live-ranges require next.
23032303
bool start_new_block=true;
2304-
int previous_address=-1;
2304+
bool has_seen_previous_address=false;
2305+
unsigned previous_address=0;
23052306
for(const auto &address_pair : address_map)
23062307
{
23072308
const unsigned address=address_pair.first;
@@ -2316,7 +2317,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
23162317
if(!start_new_block)
23172318
start_new_block=address_pair.second.predecessors.size()>1;
23182319
// Start a new lexical block if we've just entered a try block
2319-
if(!start_new_block && previous_address!=-1)
2320+
if(!start_new_block && has_seen_previous_address)
23202321
{
23212322
for(const auto &exception_row : method.exception_table)
23222323
if(exception_row.start_pc==previous_address)
@@ -2346,6 +2347,7 @@ codet java_bytecode_convert_methodt::convert_instructions(
23462347
start_new_block=address_pair.second.successors.size()>1;
23472348

23482349
previous_address=address;
2350+
has_seen_previous_address=true;
23492351
}
23502352

23512353
// Find out where temporaries are used:

src/util/std_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class struct_union_typet:public typet
215215
return set(ID_pretty_name, name);
216216
}
217217

218-
const bool get_anonymous() const
218+
bool get_anonymous() const
219219
{
220220
return get_bool(ID_anonymous);
221221
}
@@ -225,7 +225,7 @@ class struct_union_typet:public typet
225225
return set(ID_anonymous, anonymous);
226226
}
227227

228-
const bool get_is_padding() const
228+
bool get_is_padding() const
229229
{
230230
return get_bool(ID_C_is_padding);
231231
}

src/xmllang/graphml.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class graphmlt:public grapht<xml_graph_nodet>
4949
return false;
5050
}
5151

52-
const node_indext add_node_if_not_exists(std::string node_name)
52+
node_indext add_node_if_not_exists(std::string node_name)
5353
{
5454
for(node_indext i=0; i<nodes.size(); ++i)
5555
{

0 commit comments

Comments
 (0)