Work around spurious g++-12 warnings
* spot/twaalgos/ltl2tgba_fm.cc, spot/tl/formula.hh, spot/twaalgos/translate.cc: Add SPOT_ASSUME in various places to help g++.
This commit is contained in:
parent
d0ae0dfc38
commit
16373cfb10
3 changed files with 19 additions and 9 deletions
|
|
@ -294,7 +294,9 @@ namespace spot
|
|||
{
|
||||
if (SPOT_UNLIKELY(i >= size()))
|
||||
report_non_existing_child();
|
||||
return children[i];
|
||||
const fnode* c = children[i];
|
||||
SPOT_ASSUME(c != nullptr);
|
||||
return c;
|
||||
}
|
||||
|
||||
/// \see formula::ff
|
||||
|
|
|
|||
|
|
@ -1026,11 +1026,16 @@ namespace spot
|
|||
bool coacc = false;
|
||||
auto& st = sm->states_of(n);
|
||||
for (auto l: st)
|
||||
if (namer->get_name(l).accepts_eword())
|
||||
{
|
||||
coacc = true;
|
||||
break;
|
||||
}
|
||||
{
|
||||
formula lf = namer->get_name(l);
|
||||
// Somehow gcc 12.2.0 thinks lf can be nullptr.
|
||||
SPOT_ASSUME(lf != nullptr);
|
||||
if (lf.accepts_eword())
|
||||
{
|
||||
coacc = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!coacc)
|
||||
{
|
||||
// ... or if any of its successors is coaccessible.
|
||||
|
|
|
|||
|
|
@ -209,9 +209,12 @@ namespace spot
|
|||
if (!rest.empty() && !oblg.empty())
|
||||
{
|
||||
auto safety = [](formula f)
|
||||
{
|
||||
return f.is_syntactic_safety();
|
||||
};
|
||||
{
|
||||
// Prevent gcc 12.2.0 from warning us that f could be a
|
||||
// nullptr formula.
|
||||
SPOT_ASSUME(f != nullptr);
|
||||
return f.is_syntactic_safety();
|
||||
};
|
||||
auto i = std::remove_if(oblg.begin(), oblg.end(), safety);
|
||||
rest.insert(rest.end(), i, oblg.end());
|
||||
oblg.erase(i, oblg.end());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue