Hi, Michael Paquier <mich...@paquier.xyz> writes:
> [[PGP Signed Part:Undecided]] > On Tue, Aug 23, 2022 at 10:04:30AM -0700, Jacob Champion wrote: > > My main worry here is EXEC_BACKEND, where we would just use our own > implementation of fork(), and it is a bad idea at the end to leave > that untouched while we could have code paths that attempt to access > it. At the end, I have moved the initialization at the same place as > where we set MyProcPort for a backend in BackendInitialize(), mainly > as a matter of consistency because ClientConnectionInfo is aimed at > being a subset of that. And applied. I found a compiler complaint of this patch. The attached fix that. -- Best Regards Andy Fan
>From 9e8a3fb7a044704fbfcd682a897f72260266bd54 Mon Sep 17 00:00:00 2001 From: "yizhi.fzh" <yizhi....@alibaba-inc.com> Date: Thu, 15 Feb 2024 16:46:57 +0800 Subject: [PATCH v1 1/1] Remove the "parameter 'maxsize' set but not used" error. maxsize is only used in Assert build, to make compiler quiet, it is better maintaining it only assert build. --- src/backend/utils/init/miscinit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index 23f77a59e5..0e72fcefab 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -1050,7 +1050,9 @@ SerializeClientConnectionInfo(Size maxsize, char *start_address) Assert(maxsize >= sizeof(serialized)); memcpy(start_address, &serialized, sizeof(serialized)); +#ifdef USE_ASSERT_CHECKING maxsize -= sizeof(serialized); +#endif start_address += sizeof(serialized); /* Copy authn_id into the space after the struct */ -- 2.34.1