Skip to content

Commit

Permalink
Fix GCC -Wreturn-type warnings
Browse files Browse the repository at this point in the history
Always return false in PowersetAbstractDomain::contains() and
SmallSortedSetAbstractDomain::contains() to avoid a gcc warning. On
debug builds, this will instead trigger an assertion failure.
  • Loading branch information
Technius committed Dec 11, 2023
1 parent 49e71e5 commit 9f0c12d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/sparta/PowersetAbstractDomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ class PowersetAbstractDomain
return this->get_value()->contains(e);
}
}
SPARTA_ASSERT(false && "unknown AbstractValueKind");
// Return false to suppress -Wreturn-type warning reported by gcc
return false;
}

friend std::ostream& operator<<(std::ostream& o, const Derived& s) {
Expand Down
3 changes: 3 additions & 0 deletions include/sparta/SmallSortedSetAbstractDomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ class SmallSortedSetAbstractDomain final
return this->get_value()->contains(e);
}
}
SPARTA_ASSERT(false && "unknown AbstractValueKind");
// Return false to suppress -Wreturn-type warning reported by gcc
return false;
}

friend std::ostream& operator<<(std::ostream& out,
Expand Down

0 comments on commit 9f0c12d

Please sign in to comment.