seacas icon indicating copy to clipboard operation
seacas copied to clipboard

Enable compiler to detect type mismatch in exodus library

Open gsjaardema opened this issue 8 years ago • 1 comments

The exodus API can accept either 32-bit or 64-bit integers depending on the client settings and the data stored in the database. This provides flexibility, but also removes the compilers capability to warn of type mismatches.

Some clients would prefer that there be API functions with explicit int32_t or int64_t integer types so the compiler could warn if there is a type mistmatch.

Request is to add wrappers around all existing api functions that are specific for 32-bit or 64-bit integers. For example, given:

int ex_get_init(int exoid, char *title, void_int *num_dim, void_int *num_nodes,
                              void_int *num_elem, void_int *num_elem_blk, void_int *num_node_sets,
                              void_int *num_side_sets);

Provide the following two additional API functions:

int ex_get_init32(int exoid, char *title, int32_t *num_dim, int32_t *num_nodes,
                              int32_t *num_elem, int32_t *num_elem_blk, int32_t *num_node_sets,
                              int32_t *num_side_sets);

and

int ex_get_init64(int exoid, char *title, int64_t *num_dim, int64_t *num_nodes,
                              int64_t *num_elem, int64_t *num_elem_blk, int64_t *num_node_sets,
                              int64_t *num_side_sets);

These could be implemented as wrappers which would first verify that the API integer size selected for the library matches the int size of the wrapper and then would call down into the type-agnostic function.

gsjaardema avatar Mar 12 '18 14:03 gsjaardema

Stale issue message

github-actions[bot] avatar Nov 07 '20 01:11 github-actions[bot]