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 1rkHOX-00Bfby-Nb for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2024 05:43:18 +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 1rkHOW-00BRY0-0Q for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2024 05:43:16 +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.94.2) (envelope-from ) id 1rkHOV-00BRXr-Me for pgsql-hackers@lists.postgresql.org; Wed, 13 Mar 2024 05:43:16 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rkHOS-004Er1-0T for pgsql-hackers@postgresql.org; Wed, 13 Mar 2024 05:43:14 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6ddca59e336so280403a34.0 for ; Tue, 12 Mar 2024 22:43:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon.tech; s=google; t=1710308592; x=1710913392; darn=postgresql.org; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ACwZ5o+yaTn7THPXQxGLHbcmxNFnH0TLE1rP9kDkb7M=; b=U9YxZ9SiK2qJX2umdGGAmHgvDn3oH/Og4yRkoUDUtW3WFrSuxdhBUcN5Nc/uj3kgKZ +mNi4z+FSbLZ+oagqTjL2I6Z8femq/6xzkBGt3jcujlQZuW2yVSuiFFmePPMrf90GGk1 sx4siBnW394Dm/eq+yvBUXveHXyCVsPTC5Va4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710308592; x=1710913392; h=in-reply-to:references:from:to:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ACwZ5o+yaTn7THPXQxGLHbcmxNFnH0TLE1rP9kDkb7M=; b=L+tOclV0pHhUcqa04kW7Irodj5NyxPXLPiFDyKVaG23Lls9UQ2k8KZo+sxV/n4AUaH iEiod2uHvJ/Vga06xnBCs6Jd6gWGq1Uixqu5cXE45tHZc7VKOFljfywQ5uL5fu4DDLyg 6E5JLjdR+aK90BgQPSHvfNw3PBDJUvcl4GEaL3sxvWbmfjo4vqX7zdThLfLfmuWm6hAr 4cTYSkGLGneByCH1wmiO0wm3hVYAX1m7UCNbg1/F+oz7ERtgVrggeTnrQcUJhYVktFun 3TPzb4bVTxLqFFiPLUu3iwG7lhISzOuGk/PaijyagLc3W9upXwWOtRRxUKRVJlwuBFLi ftng== X-Forwarded-Encrypted: i=1; AJvYcCXUaS/nUmCo3b5ciXjX7kVgUs07EDFQ23++s0ucNGScANH+3MqL5ZvFwV+cApewNj5OYuokdoLnm3tIX/hAdcjCMk0Nzk4Bo5q3o5NP X-Gm-Message-State: AOJu0Yx7fppW32Lb5UqHcPeikxkzCwYDclOgzRUDCIkyTY2YOW942gKB 2Al1quVFoL8lRDPXgR7i+jRbNid30VIfMCgn3YDBLMOj+e1e8Q92r7Zh0BgVRTYS/9iLIpFwABN LDOI= X-Google-Smtp-Source: AGHT+IEMNc/A0O0sv1LMN+XZjFu2DJJWxxYzDtNwuT0RVEtlrBGLCIXnbu74EDOy5XPYcnjui+XBrQ== X-Received: by 2002:a9d:4f0b:0:b0:6e5:3194:a898 with SMTP id d11-20020a9d4f0b000000b006e53194a898mr578762otl.5.1710308592376; Tue, 12 Mar 2024 22:43:12 -0700 (PDT) Received: from localhost ([2607:fb91:128c:8911:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id z8-20020a056830128800b006e4fe864458sm1710242otp.54.2024.03.12.22.43.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Mar 2024 22:43:12 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed Date: Wed, 13 Mar 2024 00:43:11 -0500 Message-Id: Cc: , Subject: Re: meson: Specify -Wformat as a common warning flag for extensions To: "Sutou Kouhei" From: "Tristan Partin" X-Mailer: aerc 0.17.0-78-g4ffbaa6b3946 References: <20240313.085638.207599003452490069.kou@clear-code.com> In-Reply-To: <20240313.085638.207599003452490069.kou@clear-code.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue Mar 12, 2024 at 6:56 PM CDT, Sutou Kouhei wrote: > Hi, > > In > "Re: meson: Specify -Wformat as a common warning flag for extensions" o= n Fri, 08 Mar 2024 10:05:27 -0600, > "Tristan Partin" wrote: > > > Ok, I figured this out. -Wall implies -Wformat=3D1. We set warning_leve= l > > to 1 in the Meson project() call, which implies -Wall, and set -Wall > > in CFLAGS for autoconf. That's the reason we don't get issues building > > Postgres. A user making use of the pg_config --cflags option, as Sutou > > is, *will* run into the aforementioned issues, since we don't > > propogate -Wall into pg_config. > >=20 > > $ 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) > > Thanks for explaining this. You're right. This is the reason > why we don't need this for PostgreSQL itself but we need > this for PostgreSQL extensions. Sorry. I should have > explained this in the first e-mail... > > > What should we do to proceed this patch? Perhaps adding some more clarification in the comments that I wrote. - # -Wformat-security requires -Wformat, so check for it + # -Wformat-secuirty requires -Wformat. We compile with -Wall in=20 + # Postgres, which includes -Wformat=3D1. -Wformat is shorthand for=20 + # -Wformat=3D1. The set of flags which includes -Wformat-security is=20 + # persisted into pg_config --cflags, which is commonly used by=20 + # PGXS-based extensions. The lack of -Wformat in the persisted flags + # will produce a warning on many GCC versions, so even though adding=20 + # -Wformat here is a no-op for Postgres, it silences other use cases. That might be too long-winded though :). --=20 Tristan Partin Neon (https://neon.tech)