Violation of C standard detected by clang -fsanitize=undefined
with clang 19.1.7 on Fedora 41 x86-64.
* src/counterexample.c (si_bfs_free):
* src/files.c (prefix_map_free, add_prefix_map):
* src/fixits.c (fixit_cmp, fixit_free, fixits_register):
(expand_to_conflict, nonunifying_shift_path)
(search_state_free_children, search_state_free, ssb_free)
(ssb_hasher, ssb_comp, ssb_equals, visited_hasher)
(visited_comparator, ssb_append, unifying_example):
* src/lssi.c (lssi_free, lssi_hasher, lssi_comparator)
(shortest_path_from_start):
* src/parse-simulation.c (free_parse_state)
(parse_state_list_new, parser_pop):
* src/state-item.c (hash_pair_hasher, hash_pair_comparator)
(hash_pair_free, hash_pair_table_create):
Avoid undefined behavior in C, which does not allow you to cast a
function pointer to some other function type and then call it via
that other type. Instead, use functions with correct types
according to the C standard, and cast their parameters.
* src/getargs.c (xargmatch_fn): Return int const, not int, to
match what ARGMATCH_DEFINE_GROUP does. In all uses of
ARGMATCH_DEFINE_GROUP, say that they return int, to match
xargmatch_fn.
(FLAGS_ARGMATCH): Do not cast function pointer.
* src/parse-simulation.c (vc_derivation_list_append): New function.
* src/system.h (deconst): New static function.
When comparing traces from different machines, the mixture of
stdout/stderr in the output are making things uselessly difficult.
* src/lssi.c, src/state-item.c: Output debug traces on stderr.
There are too many gl_list_t in there, it's hard to understand what is
going on. Introduce and use more precise types. I sure can be wrong
in some places, it's hard to tell without proper tool support.
* src/counterexample.c, src/lssi.c, src/lssi.h, src/parse-simulation.c,
* src/parse-simulation.h, src/state-item.c, src/state-item.h
(si_bfs_node_list, search_state_list, ssb_list, lssi_list)
(state_item_list): New.
Prefer `&foos[i]` to `foos + i` when `foos` is an array. IMHO, it
makes the semantics clearer.
* src/counterexample.c, src/lssi.c, src/parse-simulation.c,
* src/state-item.c: With arrays, prefer the array notation rather than
the pointer one.