On Wed, Sep 24, 2025 at 4:49 AM Chao Li <[email protected]> wrote:
>
>
> On Tue, Sep 23, 2025 at 5:38 PM Peter Eisentraut <[email protected]> wrote:
>>
>>
>>
>> That said, I did go overboard here and converted all the struct/union
>> combinations I could find, but I'm not necessarily proposing to apply
>> all of them.  I'm proposing patches 0001 through 0004, which are
>> relatively simple or in areas that have already changed a few times
>> recently (so backpatching would not be trivial anyway), and/or they
>> are somewhat close to my heart because they originally motivated this
>> work a long time ago.  But if someone finds among the other patches
>> one that they particularly like, we could add that one as well.
>
>
> I went through all commits and code changes are neat and clear.
>
> But when I tried to build on my Macbook M4, it got 18 errors against 
> cryptohash.c:
> ```
> cryptohash.c:108:22: error: no member named 'data' in 'struct 
> pg_cryptohash_ctx'
>   108 |                         pg_md5_init(&ctx->data.md5);
>       |                                      ~~~  ^
... snip ...
> cryptohash.c:225:26: error: no member named 'data' in 'struct 
> pg_cryptohash_ctx'
>   225 |                         pg_sha512_final(&ctx->data.sha512, dest);
>       |                                          ~~~  ^
> 18 errors generated.

I am using meson and gcc with following versions

$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ meson --version
0.61.2

I am getting opposite of those errors

../../coderoot/pg/src/common/cryptohash.c: In function ‘pg_cryptohash_init’:
../../coderoot/pg/src/common/cryptohash.c:108:41: error:
‘pg_cryptohash_ctx’ has no member named ‘md5’
  108 |                         pg_md5_init(&ctx->md5);
      |                                         ^~
... snip ...
../../coderoot/pg/src/common/cryptohash.c:225:45: error:
‘pg_cryptohash_ctx’ has no member named ‘sha512’
  225 |                         pg_sha512_final(&ctx->sha512, dest);

Attached patch fixes those errors for me.

-- 
Best Wishes,
Ashutosh Bapat
diff --git a/src/common/cryptohash.c b/src/common/cryptohash.c
index fc0555d2f99..e8a35c2ec35 100644
--- a/src/common/cryptohash.c
+++ b/src/common/cryptohash.c
@@ -61,7 +61,7 @@ struct pg_cryptohash_ctx
 		pg_sha256_ctx sha256;
 		pg_sha384_ctx sha384;
 		pg_sha512_ctx sha512;
-	}			data;
+	};
 };
 
 /*

Reply via email to