On Mon, 2024-12-09 at 17:18 -0800, Pete Dietl wrote:
> Here is a bit of test code I came up with. Do you think this is
> necessary and or the right approach for testing with extreme values
> of double and long long?

I think the idea of setting values in config-flags.pm.in is correct,
just to keep things tidy, but I am not sure that the configure testing
is needed.

GNU Make these days requires C99 and C99 specifies that long long be at
least 64 bits.  Although that technically allows for long long to be
more than 64 bits, I'm pretty sure that we won't ever see a system
where long long is not exactly 64 bits: hopefully everyone agrees that
the mess we had with long vs. long long was a big mistake and when C
decides to standardize larger integers, they'll create a new type for
it.

I don't think it's worthwhile spending a lot of effort trying to
support systems where long long is >64bits.  So, I would just use a
constant 9223372036854775807 and -9223372036854775808 rather than try
to compute it at configure time.

For the tests, that's a good start but please try to cover all the
special cases etc.

However, I don't think you need to use the Math::BigInt module.  You
can simply add "use integer;" at the start of your test file and it
should work to use simple math.

-- 
Paul D. Smith <psm...@gnu.org>            Find some GNU Make tips at:
https://www.gnu.org                       http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad
Scientist




Reply via email to