Re: anonymous unions (C11)

Поиск
Список
Период
Сортировка
От Chao Li
Тема Re: anonymous unions (C11)
Дата
Msg-id CAEoWx2mv41hcyQAs2svi0ZSVW5C7T+DfD7=N-DR1L3cAPs2jXA@mail.gmail.com
обсуждение исходный текст
Ответ на anonymous unions (C11)  (Peter Eisentraut <peter@eisentraut.org>)
Ответы Re: anonymous unions (C11)
Список pgsql-hackers

On Tue, Sep 23, 2025 at 5:38 PM Peter Eisentraut <peter@eisentraut.org> 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);
      |                                      ~~~  ^
cryptohash.c:111:23: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  111 |                         pg_sha1_init(&ctx->data.sha1);
      |                                       ~~~  ^
cryptohash.c:114:25: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  114 |                         pg_sha224_init(&ctx->data.sha224);
      |                                         ~~~  ^
cryptohash.c:117:25: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  117 |                         pg_sha256_init(&ctx->data.sha256);
      |                                         ~~~  ^
cryptohash.c:120:25: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  120 |                         pg_sha384_init(&ctx->data.sha384);
      |                                         ~~~  ^
cryptohash.c:123:25: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  123 |                         pg_sha512_init(&ctx->data.sha512);
      |                                         ~~~  ^
cryptohash.c:144:24: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  144 |                         pg_md5_update(&ctx->data.md5, data, len);
      |                                        ~~~  ^
cryptohash.c:147:25: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  147 |                         pg_sha1_update(&ctx->data.sha1, data, len);
      |                                         ~~~  ^
cryptohash.c:150:27: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  150 |                         pg_sha224_update(&ctx->data.sha224, data, len);
Fixed build failure on Macbook M4
      |                                           ~~~  ^
cryptohash.c:153:27: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  153 |                         pg_sha256_update(&ctx->data.sha256, data, len);
      |                                           ~~~  ^
cryptohash.c:156:27: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  156 |                         pg_sha384_update(&ctx->data.sha384, data, len);
      |                                           ~~~  ^
cryptohash.c:159:27: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  159 |                         pg_sha512_update(&ctx->data.sha512, data, len);
      |                                           ~~~  ^
cryptohash.c:185:23: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  185 |                         pg_md5_final(&ctx->data.md5, dest);
      |                                       ~~~  ^
cryptohash.c:193:24: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  193 |                         pg_sha1_final(&ctx->data.sha1, dest);
      |                                        ~~~  ^
cryptohash.c:201:26: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  201 |                         pg_sha224_final(&ctx->data.sha224, dest);
      |                                          ~~~  ^
cryptohash.c:209:26: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  209 |                         pg_sha256_final(&ctx->data.sha256, dest);
      |                                          ~~~  ^
cryptohash.c:217:26: error: no member named 'data' in 'struct pg_cryptohash_ctx'
  217 |                         pg_sha384_final(&ctx->data.sha384, dest);
      |                                          ~~~  ^
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.
```

With the attached fix, the build passed then, "make check" also passed.

Chao Li (Evan)
---------------------
HighGo Software Co., Ltd.
Вложения

В списке pgsql-hackers по дате отправления: