25 for(
const auto &symbol_pair : symbol_table.
symbols)
27 if(symbol_pair.second.is_type && symbol_pair.second.type.id() == ID_struct)
32 bool first_time_seen_in_struct =
true;
34 for(struct_typet::componentst::const_iterator it_mem = components.begin();
35 it_mem != components.end();
39 bool first_time_seen_from =
true;
44 if(it_mem->get_is_padding())
48 for(struct_typet::componentst::const_iterator it_next = it_mem;
49 it_next != components.end();
52 const typet &it_type = it_next->type();
57 throw "type of unknown size:\n" + it_type.
pretty();
59 cumulated_length += *size;
65 if(!first_time_seen_from)
70 if(it_mem != it_next && !it_next->get_is_padding())
72 if(first_time_seen_in_struct)
74 first_time_seen_in_struct =
false;
75 first_time_seen_from =
false;
78 <<
"declaration of structure "
80 << symbol_pair.second.location <<
'\n';
83 out <<
"members " << it_mem->get_pretty_name() <<
" and "
84 << it_next->get_pretty_name() <<
" might interfere\n";
89 else if(symbol_pair.second.type.id() == ID_array)
99 throw "type of unknown size:\n"+it_type.pretty();
104 <<
"declaration of an array at "
105 << symbol_pair.second.location <<
106 <<
"\nmight be concurrently accessed\n";