Re: Fix last unitialized memory warning

Поиск
Список
Период
Сортировка
Искать
От
Tristan Partin
Тема
Re: Fix last unitialized memory warning
Дата
Msg-id
CUO4DOBLGCGQ.2O00AZU0E82UY@gonk
Ответ на
Список
Дерево обсуждения
Fix last unitialized memory warning "Tristan Partin" <tristan@neon.tech>
Re: Fix last unitialized memory warning Peter Eisentraut <peter@eisentraut.org>
Re: Fix last unitialized memory warning "Tristan Partin" <tristan@neon.tech>
Re: Fix last unitialized memory warning Peter Eisentraut <peter@eisentraut.org>
Re: Fix last unitialized memory warning Andres Freund <andres@anarazel.de>
Re: Fix last unitialized memory warning "Tristan Partin" <tristan@neon.tech>
Re: Fix last unitialized memory warning Peter Eisentraut <peter@eisentraut.org>
Re: Fix last unitialized memory warning "Tristan Partin" <tristan@neon.tech>
Re: Fix last unitialized memory warning Peter Eisentraut <peter@eisentraut.org>
Re: Fix last unitialized memory warning "Tristan Partin" <tristan@neon.tech>
Re: Fix last unitialized memory warning Peter Eisentraut <peter@eisentraut.org>
Re: Fix last unitialized memory warning Peter Eisentraut <peter@eisentraut.org>
Re: Fix last unitialized memory warning "Tristan Partin" <tristan@neon.tech>
Re: Fix last unitialized memory warning Julien Rouhaud <rjuju123@gmail.com>
Re: Fix last unitialized memory warning Richard Guo <guofenglinux@gmail.com>
Re: Fix last unitialized memory warning Peter Eisentraut <peter@eisentraut.org>
Re: Fix last unitialized memory warning Gurjeet Singh <gurjeet@singh.im>
On Wed Aug 9, 2023 at 10:02 AM CDT, Peter Eisentraut wrote:
> On 09.08.23 10:07, Peter Eisentraut wrote:
> > On 08.08.23 17:14, Tristan Partin wrote:
> >>> I was able to reproduce the warning now on Fedora.  I agree with the 
> >>> patch
> >>>
> >>> -       PgBenchValue vargs[MAX_FARGS];
> >>> +       PgBenchValue vargs[MAX_FARGS] = { 0 };
> >>>
> >>> I suggest to also do
> >>>
> >>>   typedef enum
> >>>   {
> >>> -       PGBT_NO_VALUE,
> >>> +       PGBT_NO_VALUE = 0,
> >>>
> >>> to make clear that the initialization value is meant to be invalid.
> >>>
> >>> I also got the plpgsql warning that you showed earlier, but I 
> >>> couldn't think of a reasonable way to fix that.
> >>
> >> Applied in v2.
> > 
> > committed
>
> This patch has apparently upset one buildfarm member with a very old 
> compiler: 
> https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=lapwing&br=HEAD
>
> Any thoughts?

Best I could find is SO question[0] which links out to[1]. Try this 
patch. Otherwise, a memset() would probably do too.

[0]: https://stackoverflow.com/questions/13746033/how-to-repair-warning-missing-braces-around-initializer
[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

-- 
Tristan Partin
Neon (https://neon.tech)
В списке pgsql-hackers по дате отправления
От: David Rowley
Дата:
От: GF
Дата:
FAQ