Re: src/include/utils/float.h comment one link stable
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>,
jian he <jian.universality@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-10-06T15:24:39Z
Lists: pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes: > Going by the draft C11 standard in [3], on page 230 it looks like > INFINITY is always defined now, so maybe we can get rid of the other > code and just always "return (float4) INFINITY;"? I did try that with > VS2022 just to make sure and I don't get a warning. +1, let's give that a try. However, INFINITY has been required since C99, so please don't change that comment. I wonder if we couldn't also remove the NAN hacks in the same file. NAN's been required since C99 as well, and it's equally hard to believe that we still need to support compilers that don't conform. (Strictly speaking, NAN is required only if the underlying float implementation has it. But we desupported non-IEEE float arithmetic years ago.) regards, tom lane
Commits
-
Cleanup NAN code in float.h, too.
- 14ad0d7bf2b8 19 (unreleased) landed
-
Cleanup INFINITY code in float.h
- 3bf905692c9d 19 (unreleased) landed
-
Enable MSVC conforming preprocessor
- 8fd9bb1d9654 19 (unreleased) cited