Re: Pointer subtraction with a null pointer
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>,
Thomas Munro <thomas.munro@gmail.com>
Date: 2022-03-26T18:13:56Z
Lists: pgsql-hackers
Attachments
- silence-null-subtraction-warning-2.patch (text/x-diff) patch
Andres Freund <andres@anarazel.de> writes: > Wonder if we should try to get rid of the problem by also fixing the double > evaluation of val? I think something like Good idea. The attached also silences the warning, and getting rid of the double-eval hazard seems like a net win. > Might also be worth adding an assertion that base < val. Did that too. On the whole I like this better. regards, tom lane
Commits
-
Suppress compiler warning in relptr_store().
- e07d4ddc55fd 15.0 landed
- 403a8c76293b 10.21 landed
- a2a1aa830a1c 11.16 landed
- cb8586d0514b 12.11 landed
- 4fbbea2c1934 13.7 landed
- 0144c9c7e73d 14.3 landed