public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Andres Freund <[email protected]>
Cc: [email protected]
Subject: Re: pgsql: aio: Add core asynchronous I/O infrastructure
Date: Tue, 18 Mar 2025 11:03:36 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Andres Freund <[email protected]> writes:
> aio: Add core asynchronous I/O infrastructure

Some of the buildfarm is mildly unhappy with this.
So far I see

 ayu           | 2025-03-18 13:08:04 | aio_callback.c:83:12: warning: comparison of constant 1 with expression of type 'PgAioHandleCallbackID' (aka 'enum PgAioHandleCallbackID') is always false [-Wtautological-constant-out-of-range-compare]
 ayu           | 2025-03-18 13:08:04 | aio_callback.c:190:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 ayu           | 2025-03-18 13:08:04 | aio_callback.c:220:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 ayu           | 2025-03-18 13:08:04 | aio_callback.c:274:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 ayu           | 2025-03-18 13:08:04 | aio_target.c:50:41: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 ayu           | 2025-03-18 13:08:04 | aio_target.c:110:41: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 demoiselle    | 2025-03-18 03:43:46 | aio_callback.c:83:12: warning: comparison of constant 1 with expression of type 'PgAioHandleCallbackID' (aka 'enum PgAioHandleCallbackID') is always false [-Wtautological-constant-out-of-range-compare]
 demoiselle    | 2025-03-18 03:43:46 | aio_callback.c:190:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 demoiselle    | 2025-03-18 03:43:46 | aio_callback.c:220:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 demoiselle    | 2025-03-18 03:43:46 | aio_callback.c:274:56: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 demoiselle    | 2025-03-18 03:43:46 | aio_target.c:50:41: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]
 demoiselle    | 2025-03-18 03:43:46 | aio_target.c:110:41: warning: comparison of constant 1 with expression of type 'PgAioTargetID' (aka 'enum PgAioTargetID') is always true [-Wtautological-constant-out-of-range-compare]

I don't have that compiler handy to check, but maybe changes like

-	if (cb_id >= lengthof(aio_handle_cbs))
+	if ((size_t) cb_id >= lengthof(aio_handle_cbs))

would silence these?  Or you could just drop all those tests
and have faith in the type-safety of the enums.

			regards, tom lane





view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: pgsql: aio: Add core asynchronous I/O infrastructure
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox