Re: gcc 12.1.0 warning - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: gcc 12.1.0 warning
Date
Msg-id ZpVZB9rH5tHllO75@nathan
Whole thread Raw
In response to Re: gcc 12.1.0 warning  (Andres Freund <andres@anarazel.de>)
Responses Re: gcc 12.1.0 warning
List pgsql-hackers
On Mon, Jul 15, 2024 at 09:41:55AM -0700, Andres Freund wrote:
> On 2024-05-10 12:13:21 +0300, Nazir Bilal Yavuz wrote:
>> The fix is attached. It cleanly applies from REL_15_STABLE to
>> REL_12_STABLE, fixes the warnings and the tests pass.
> 
> Thanks! I've applied it to all branches - while it's not required to avoid a
> warning in newer versions, it's still not correct as it was...

nitpick: pgindent thinks one of the spaces is unnecessary.

diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index a043d529ef..b0947a4cf1 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1289,8 +1289,8 @@ find_option(const char *name, bool create_placeholders, bool skip_errors,
 static int
 guc_var_compare(const void *a, const void *b)
 {
-    const char *namea = **(const char ** const *) a;
-    const char *nameb = **(const char ** const *) b;
+    const char *namea = **(const char **const *) a;
+    const char *nameb = **(const char **const *) b;

     return guc_name_compare(namea, nameb);
 }

-- 
nathan



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Upgrade Debian CI images to Bookworm
Next
From: Nathan Bossart
Date:
Subject: Re: Restart pg_usleep when interrupted