23 if(it->second.is_type && it->second.type.id()==ID_struct)
28 bool first_time_seen_in_struct=
true;
30 for(struct_typet::componentst::const_iterator
31 it_mem=components.begin();
32 it_mem!=components.end();
36 bool first_time_seen_from=
true;
41 if(it_mem->get_is_padding())
45 for(struct_typet::componentst::const_iterator
47 it_next!=components.end();
50 const typet &it_type=it_next->type();
55 throw "type of unknown size:\n"+it_type.
pretty();
57 cumulated_length+=size;
63 if(!first_time_seen_from)
68 if(it_mem!=it_next && !it_next->get_is_padding())
70 if(first_time_seen_in_struct)
72 first_time_seen_in_struct=
false;
73 first_time_seen_from=
false;
76 <<
"declaration of structure " 78 <<
" at " << it->second.location <<
'\n';
81 out <<
"members " << it_mem->get_pretty_name() <<
" and " 82 << it_next->get_pretty_name() <<
" might interfere\n";
87 else if(it->second.type.id()==ID_array)
97 throw "type of unknown size:\n"+it_type.pretty();
102 <<
"declaration of an array at " 103 << it->second.location <<
104 <<
"\nmight be concurrently accessed\n";
The type of an expression.
struct configt::ansi_ct ansi_c
#define forall_symbols(it, expr)
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
void print_struct_alignment_problems(const symbol_tablet &symbol_table, std::ostream &out)
std::vector< componentt > componentst
const componentst & components() const
mp_integer pointer_offset_size(const typet &type, const namespacet &ns)
const array_typet & to_array_type(const typet &type)
Cast a generic typet to an array_typet.
unsigned memory_operand_size
const struct_typet & to_struct_type(const typet &type)
Cast a generic typet to a struct_typet.
const typet & find_type(const irep_namet &name) const
const typet & subtype() const