Closed schwehr closed 1 year ago
I see a number of ways to quickly improve the HDF4 codebase so that it can live as long as possible with the minimum of future upkeep work. A lot of this stuff was done to GDAL and some to shapelib, mb-system, etc. e.g. https://github.com/OSGeo/shapelib/issues/17 And I see that there has been some start to a few of these
#ifdef
blocks:
FALSE
and TRUE
These can be a lot smaller:
find . -name "*.[chf]" | xargs wc -l | grep total
273734 total
After looking at the build system and CI setup, it looks like hdf4 would benefit from:
More cleanup ideas
We'll be making many of these changes over the next year or so in an effort to make HDF4 into a more maintainable piece of software. Some of them will make it into 4.2.16, but others will have to wait until later in the year, as we get 4.2.17 together.
Just a note that I've seen massive amounts of cleanup in the last couple weeks. There is alway always more that can be done, but the code is a lot easier to work with. One of the biggest improvements so far is removing a lot of the dead code.
There are still a lot of folks using hdf4 around (I'm one of them). I've seen a few fuzzer bugs in prior versions and am having trouble getting all the platforms I have to support working with the version at head (e.g. x86-64, ppc, and arm). Before trying to dig into more, I figured I'd start with my current default compiler and see if I can do some low risk code cleanup if folks are up for it. My initial run as seeing what compiler warnings are showing up:
I had trouble with being able to turn off
-pedantic
, so I commented that out in https://github.com/HDFGroup/hdf4/blob/31f75f7123037768f4bc1b4ee48321316e1eaf5b/config/cmake/HDFCompilerFlags.cmake#L159And here here in https://github.com/HDFGroup/hdf4/blob/31f75f7123037768f4bc1b4ee48321316e1eaf5b/config/cmake/HDFCompilerFlags.cmake#L159
I will try to make some manageable pull requests that just address one of those compiler warnings at a time (as I have time).
Also, I see reference to things like VAX and
$Id
that are easy cleanups.