netcdf-c icon indicating copy to clipboard operation
netcdf-c copied to clipboard

Fix most warnings in `dumplib.c`

Open ZedThree opened this issue 1 year ago • 0 comments

The easy win here was changing the return type of sbuf_len which is used in a lot of places in this file. Two alternatives that I think would be cleaner but require touching more places:

  1. Change the typ_tostring_func function pointer typedef to return size_t. This is more correct as it matches the current return type of sbuf_len, which is returned from the implementations of this prototype.
  2. Change the typ_tostring_func return type to void -- as far as I can tell, the return value of these functions isn't used anywhere that they're called, I think it's an entirely internal module. Doing this would also mean that the call to sbuf_len in these functions could also be removed entirely

This PR fixes about 55 warnings

ZedThree avatar Nov 28 '23 17:11 ZedThree