-
-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Description
Problem description
In the following snippet
cantera/include/cantera/base/Solution.h
Lines 117 to 119 in e6f3e9d
| string adjacentName(size_t i) const { | |
| if (i < 0 || i >= m_adjacent.size()) { | |
| throw CanteraError("Solution::adjacentName", "Invalid index {}.", i); |
i is unsigned, but i < 0 is checked. This currently generates a warning (at least with gcc 14). I think most often, indices in Cantera are defined as size_t, so the check should be superfluous. But if this is called in other language interfaces, an error message with a signed index might be more helpful to the user (if e.g. -1 is passed). What do you think?Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels