BUG #19343: toast_internals.c:139:2: warning: missing braces around initializer [-Wmissing-braces]

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: natalie(dot)reno(at)cchmc(dot)org
Subject: BUG #19343: toast_internals.c:139:2: warning: missing braces around initializer [-Wmissing-braces]
Date: 2025-12-02 19:41:40
Message-ID: 19343-bac8653701266869@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19343
Logged by: Natalie Reno
Email address: natalie(dot)reno(at)cchmc(dot)org
PostgreSQL version: 16.11
Operating system: RHEL7
Description:

When compiling the latest version, 16.11, I received the following error:
gcc -std=gnu99 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Werror=vla -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -O2 -I../../../../src/include -D_GNU_SOURCE
-c -o toast_internals.o toast_internals.c
toast_internals.c: In function ‘toast_save_datum’:
toast_internals.c:139:2: warning: missing braces around initializer
[-Wmissing-braces]
} chunk_data = {0}; /* silence compiler warning */
^
toast_internals.c:139:2: warning: (near initialization for ‘chunk_data.hdr’)
[-Wmissing-braces]

When I compared toast_internals.c files between 16.11 and 16.10, I found
this difference that is supposed to account for silencing the compiler
warning.

diff
/u01/app/postgres/product/postgresql-16.11/src/backend/access/common/toast_internals.c
/u01/app/postgres/product/postgresql-16.10/src/backend/access/common/toast_internals.c
139c139
< } chunk_data = {0}; /* silence compiler
warning */ <-- 16.11
---
> } chunk_data; <-- 16.10

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-12-02 20:26:43 Re: BUG #19340: Wrong result from CORR() function
Previous Message Dean Rasheed 2025-12-02 18:54:20 Re: BUG #19340: Wrong result from CORR() function