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.94.2) (envelope-from ) id 1ricj3-000eDI-5J for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Mar 2024 16:05:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ricj0-00DsO9-8R for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Mar 2024 16:05:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1riciz-00DsO1-UK for pgsql-hackers@lists.postgresql.org; Fri, 08 Mar 2024 16:05:34 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1riciw-003SeQ-Vt for pgsql-hackers@postgresql.org; Fri, 08 Mar 2024 16:05:33 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6e4e952467fso520987a34.2 for ; Fri, 08 Mar 2024 08:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon.tech; s=google; t=1709913929; x=1710518729; darn=postgresql.org; h=in-reply-to:references:subject:cc:from:to:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=jXP+k7hfK+7qjnv+brmOfWK5ddAirJ0/gPzIgG0xjgM=; b=fypruiv4aHZqQIBfG6ySKJs0+Q2YwcQNpGbY3wbH6R7gV7Umwi654DBX9q+Hc++H0q lfMO1VPmtvj4IpssFLeCUagqVcXZoNy19gjElxFA+qZ3FARgPno7lD6OIdfb4pCnJDYK iZTe3vQ7vOMDjjB4hgCJXfrhCco86GR5MoooA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709913929; x=1710518729; h=in-reply-to:references:subject:cc:from:to:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=jXP+k7hfK+7qjnv+brmOfWK5ddAirJ0/gPzIgG0xjgM=; b=Eqc4yY4lDuNzwng5IYxtRRYwObPOVAbGpAQCLjV06Ey6X5oS7PAwDSPk60Faf74c4Z 6Abd2EB2iXg9ze0kqb/BGYvm/WWLksFbjUZZS9k58WbEoY5FN1vsf+5JXLDZwAOFU4/H faq1g49kvDFj7PB+nLoRn2Kyq4pz5FdJrKRDm5MHqYOqxsfzHIbTaEUIQ0mlNuL6nK/b sB0ZsunhTR/eObguzwGr0YWFDhUQbJv6LJdDpuNR5rk5m1XjdXGIZAJNuOhr55V/MKun /dNCVn6kh6gseu2BVym4HZ7QYEdG66RGQdWtSePYOi1rEoT1LqoUEj7Rg9SsWAu0PR+w p/Xw== X-Forwarded-Encrypted: i=1; AJvYcCWXpLGvrB3zfTy9iKPwl4JkmuhbtoIzZKTYOL+O2Dqr8VQz/q7Qf585D7wZNRa2FHsgl8yD6tronnWQ5xBQx3q6wQU6yacCQXMb8SeB X-Gm-Message-State: AOJu0Yya6xtUMbitE6bbK9i5CRtXx2UdS+aC8QKcNp4Td9rRgdHJ2Ffh 4JhAi28Ue+YPEbaIqEhsyPepjrSccQBPmIR9KhU415la32dac+FAfn1f0NSVxzj3Cm4+HYvmJg0 9TLs= X-Google-Smtp-Source: AGHT+IEVV8U+oc+8330NDf/J1dlbVXkHkYMiDy2IpbN8FzSUppqKnuc7ihsxjY+mYhl2Q+HeHFTcxQ== X-Received: by 2002:a05:6830:1da8:b0:6e4:e561:6ba7 with SMTP id z8-20020a0568301da800b006e4e5616ba7mr11878635oti.25.1709913928926; Fri, 08 Mar 2024 08:05:28 -0800 (PST) Received: from localhost ([2607:fb91:121c:5d6:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id e4-20020a9d63c4000000b006e4f0826ee6sm1510733otl.43.2024.03.08.08.05.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Mar 2024 08:05:28 -0800 (PST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed Date: Fri, 08 Mar 2024 10:05:27 -0600 Message-Id: To: "Michael Paquier" From: "Tristan Partin" Cc: "Sutou Kouhei" , Subject: Re: meson: Specify -Wformat as a common warning flag for extensions X-Mailer: aerc 0.17.0-72-g6a84f1331f1c-dirty References: <20240122.141139.931086145628347157.kou@clear-code.com> In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri Mar 8, 2024 at 12:32 AM CST, Michael Paquier wrote: > On Thu, Mar 07, 2024 at 11:39:39PM -0600, Tristan Partin wrote: > > It sounds like a legitimate issue. I have confirmed the issue exists wi= th a > > pg_config compiled with Meson. I can also confirm that this issue exist= s in > > the autotools build. > > First time I'm hearing about that, but I'll admit that I am cheating > because -Wformat is forced in my local builds for some time now. I'm > failing to see the issue with meson and ./configure even if I remove > the switch, though, using a recent version of gcc at 13.2.0, but > perhaps Debian does something underground. Are there version and/or > environment requirements to be aware of? > > Forcing -Wformat implies more stuff that can be disabled with > -Wno-format-contains-nul, -Wno-format-extra-args, and > -Wno-format-zero-length, but the thing is that we're usually very > conservative with such additions in the scripts. See also > 8b6f5f25102f, done, I guess, as an answer to this thread: > https://www.postgresql.org/message-id/4D431505.9010002%40dunslane.net > > A quick look at the past history of pgsql-hackers does not mention > that as a problem, either, but I may have missed something. Ok, I figured this out. -Wall implies -Wformat=3D1. We set warning_level=20 to 1 in the Meson project() call, which implies -Wall, and set -Wall in=20 CFLAGS for autoconf. That's the reason we don't get issues building=20 Postgres. A user making use of the pg_config --cflags option, as Sutou=20 is, *will* run into the aforementioned issues, since we don't propogate=20 -Wall into pg_config. $ gcc $(pg_config --cflags) -E - < /dev/null > /dev/null cc1: warning: =E2=80=98-Wformat-security=E2=80=99 ignored without =E2=80= =98-Wformat=E2=80=99 [-Wformat-security] $ gcc -Wall $(pg_config --cflags) -E - < /dev/null > /dev/null (nothing printed) --=20 Tristan Partin Neon (https://neon.tech)