Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQivg-00FvkV-2a for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Dec 2025 09:13:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vQivf-00COyt-1T for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Dec 2025 09:13:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQivf-00COyk-0S for pgsql-bugs@lists.postgresql.org; Wed, 03 Dec 2025 09:13:43 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vQivb-002tmW-30 for pgsql-bugs@lists.postgresql.org; Wed, 03 Dec 2025 09:13:42 +0000 Received: from [10.0.2.15] (unknown [130.41.208.2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4dLsPp0H4wz49QB2; Wed, 03 Dec 2025 11:13:33 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1764753214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9YFLpoLCjsLHo8o3VH1jY3y61VDvTerO2Cp0RAZAemY=; b=BVSuYZCS1k/dvhim/qgIiKL103eHaKwtWGdx/RkrlInohgUf/ykVZpQiHFOD61ZJx1u9Q1 N4yZQpFqrejLbnP9506ambLh/3abRWt39Wp2K03XI2G7OwsXI4bL5Cu2G6SLcdahQdHL10 hv5mHQKPbDkhlxoghOZx2Opy0Owb2dehnSKtCsGOc9mZZvtonE4gf/L5jhI3Oklpe756Sl PZWSWmZGkxWrPp16jYEqsdyXD0ep2s0KEtAw/cC8tLtpyJUfGvAT7stPza2oNcp6c3etf7 CTC1fEDO6Y5eXRpI3A40wguiozTYEuY12rEbOQzyrs1J2J1eLID4BYaI3iBJUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1764753214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9YFLpoLCjsLHo8o3VH1jY3y61VDvTerO2Cp0RAZAemY=; b=kLmQ8sRiPUApFlr5pCpJKNaiyy5oMxHixxx7x2Sn2YHHaoC3oHmP43V1MQjAfqxugSQAck ASKB4BoIJw2xQA3NwAhRBXXV2k7T4i9s2FIUKVW1lm+QY2LrVkFkwx35fmg+nQ70ZQPfFO gfxVZtS7PqqtuVzs6LYQsCekAJDK5fv53iR89hQnMOKeVasv4SWlo3A+6YfCKMtou5uU6T al9lv0rfiWmlz/BlUf+4Saj28sC5pIn4YLdrFq2jlGOqEurHzeMBW3+wlC2+1dI6904sLQ /xWBF7KlX8OueMG7e9kkF86yx1VeVhDOmUJBIl6zVeVxm7uNWtfvoaOoFzFw7Q== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1764753214; b=jMSSxJq1q+u2xa25Q7eRQVuUZOQ+ZCGARJ+fe2lFGk2s1zm9MAATEq8ceKRyF4dxVOISw6 Cl21zmQwKMTVG/o+MbwtoqZjomDjqOeUULZeLWOp1xswhA9N4A+phttSVyY8NR+oz27+Dq QHR6FObgf3j3+GWO+K6ksRTpB14sIok2jqlwlyPTsgggjRjF+4nUfHprbonntbLLmlgj+Q 9CGTZBqS+g/2KxhQZ566Td7pKV8ItoQrXDZNd47aft/JyGYt0V4Nsi6s9RZlYzwxhuNOl5 OMJqKXbn69Q9NpyImgcg3Ru1YMAZ3PNKfBCXxRocsQeeQ3zFXm3O4UHaU6dMGg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: <2a35c8f8-b610-412c-b234-2570e2b97a37@iki.fi> Date: Wed, 3 Dec 2025 11:13:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #19343: toast_internals.c:139:2: warning: missing braces around initializer [-Wmissing-braces] To: natalie.reno@cchmc.org, pgsql-bugs@lists.postgresql.org, Peter Eisentraut References: <19343-bac8653701266869@postgresql.org> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: <19343-bac8653701266869@postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 02/12/2025 21:41, PG Bug reporting form wrote: > The following bug has been logged on the website: `> > Bug reference: 19343 > Logged by: Natalie Reno > Email address: natalie.reno@cchmc.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 On 'master', this was done slightly differently, see commit 748caa9dcb. Peter decided to only do that bigger code rearrangement on 'master', and do the less invasive initialization on backbranches [1]. I think we should just backpatch the bigger code rearrangement too. [1] https://www.postgresql.org/message-id/76f41fdc-69e1-43b4-b9aa-503b07980de1%40eisentraut.org - Heikki