Re: Compile warnings in dbcommands.c building with meson

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: Compile warnings in dbcommands.c building with meson
Дата
Msg-id CAJ7c6TNz-qTd-_4YayUC4A-X4993aiobNZ=r7o2oh2n0PJvCnA@mail.gmail.com
обсуждение исходный текст
Ответ на Compile warnings in dbcommands.c building with meson  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: Compile warnings in dbcommands.c building with meson  (Magnus Hagander <magnus@hagander.net>)
Re: Compile warnings in dbcommands.c building with meson  (jian he <jian.universality@gmail.com>)
Список pgsql-hackers
Hi,

> When building current head on debian bullseye I get this compile warning:
>
> In file included from ../src/backend/commands/dbcommands.c:20:
> ../src/backend/commands/dbcommands.c: In function ‘createdb’:
> ../src/include/postgres.h:104:9: warning: ‘src_hasloginevt’ may be
> used uninitialized in this function [-Wmaybe-uninitialized]
>   104 |  return (Datum) (X ? 1 : 0);
>       |         ^~~~~~~~~~~~~~~~~~~
> ../src/backend/commands/dbcommands.c:683:8: note: ‘src_hasloginevt’
> was declared here
>   683 |  bool  src_hasloginevt;
>       |        ^~~~~~~~~~~~~~~
>
>
> I only get this when building with meson, not when building with
> autotools. AFAICT, I have the same config:
>
> ./configure --enable-debug --enable-depend --with-python
> --enable-cassert --with-openssl --enable-tap-tests --with-icu
>
> vs
>
> meson setup build -Ddebug=true -Dpython=true -Dcassert=true
> -Dssl=openssl -Dtap-test=true -Dicu=enabled -Dnls=disabled
>
>
> in both cases the compiler is:
> gcc (Debian 10.2.1-6) 10.2.1 20210110

Seems to me that the compiler is not smart enough to process:

```
    if (!get_db_info(dbtemplate, ShareLock,
                     &src_dboid, &src_owner, &src_encoding,
                     &src_istemplate, &src_allowconn, &src_hasloginevt,
                     &src_frozenxid, &src_minmxid, &src_deftablespace,
                     &src_collate, &src_ctype, &src_iculocale,
&src_icurules, &src_locprovider,
                     &src_collversion))
        ereport(ERROR, ...
```

Should we just silence the warning like this - see attachment? I don't
think createdb() is called that often to worry about slight
performance change, if there is any.

--
Best regards,
Aleksander Alekseev

Вложения

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

Предыдущее
От: Aleksander Alekseev
Дата:
Сообщение: Re: Slightly improved meson error for docs tools
Следующее
От: "Zhijie Hou (Fujitsu)"
Дата:
Сообщение: RE: Synchronizing slots from primary to standby