Take a look at the following code snippet. It was written in 2005, but I collect it with the latest gcc.
xln_merge_nodes_without_lindo(coeff, cand_node_array, match1_array, match2_array) sm_matrix *coeff; array_t *cand_node_array, *match1_array, *match2_array; { node_t *n1, *n2; sm_row *row1, *row2; static sm_row *xln_merge_find_neighbor_of_row1_with_minimum_neighbors(); while (TRUE) { row1 = sm_shortest_row(coeff); if (row1 == NIL (sm_row)) return; n1 = array_fetch(node_t *, cand_node_array, row1->row_num); row2 = xln_merge_find_neighbor_of_row1_with_minimum_neighbors(row1, coeff); n2 = array_fetch(node_t *, cand_node_array, row2->row_num); array_insert_last(node_t *, match1_array, n1); array_insert_last(node_t *, match2_array, n2); xln_merge_update_neighbor_info(coeff, row1, row2); } }
When compiling, he complains
xln_merge.c:299:18: error: invalid storage class for function 'xln_merge_find_neighbor_of_row1_with_minimum_neighbors'
(xln_merger.c: 299 is line 3 here after the start of the definition).
The definition of the function of line 3 seems to be a function declaration (isn't it?). Did the programmer intend to write a function pointer (static)? Or some kind of syntax has changed over time in c, why is this not compiling.
This code is from sis package here
source share