I'm taking gcc 12.2 for a test drive today.
It reports a few warnings that slipped through earlier versions.
None of the warnings concern me for actual code safety,
but I went ahead and resolved them to keep the build clean.
Also provide a hook for a CPP environment variable to override
the C++ compiler to use, instead of forcing g++.
There was one more place where novas.c calls abs()
that caused a warning when compiled on the Mac.
It was passing long int to abs(). To be abundantly
cautious, instead of using labs(), I just manually
check for negative values and toggle -- inline abs.
I received a report that there are compiler warnings
that break the build in novas.c when building on the Mac.
In two cases, long integers are passed to abs(), which expects
its argument to be int. The warnings broke the build
of the 'generate' program. I patched the code so these
warnings should no longer occur, though I do not have a
Mac to test. Will ask the correspondent to test for me.
The newer gcc generates warnings when a function
is declared to take a sized array parameter, but the caller
passes an array of smaller dimension. In these cases, the
intention was to pass arrays of variable size, so I deleted
the specific array sizes.
Version 9.3.0 of gcc has extra warnings that detect snprintf
truncations and use of possibly uninitialized variables.
Fixed some warnings of both types.
Compiler does not understand that there is no need for
a switch default because the enclosing switch statement
has already guarded against that. Changed to ternary
operator to make compiler warning go away.
The original code really is ignoring fread() return values.
That is not good.
But right now I just want it to build without warnings
so I patched the code to make the warnings go away.