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 1t4s8O-002jUM-TV for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Oct 2024 01:32:01 +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 1t4s7N-00D1hf-0i for pgsql-hackers@arkaria.postgresql.org; Sun, 27 Oct 2024 01:30:57 +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 1t4s7M-00D1hV-92 for pgsql-hackers@lists.postgresql.org; Sun, 27 Oct 2024 01:30:57 +0000 Received: from m16.mail.163.com ([220.197.31.5]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t4s7B-003ArP-Nf for pgsql-hackers@lists.postgresql.org; Sun, 27 Oct 2024 01:30:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=ugwHeOh+ce3CkLnZCPb+qB+MmnTJecwSrvBTrsBVmcg=; b=l1h2q6mvlfJUNRn5vRXSmIRhjiyCerUw7AyxUX3s8SrxO9RfLPdSFi6i0mSTV0 YU9wKmUmIfwRqd5C8hReIMycqsMTq1ooLI/5JAXjRueVY8ZpI4mhAxD3zULqxoRH jVdx6LVuzkRDgWDdrcmrMNdyNH1JkcqQqNG65WCDRE8X0= Received: from lovely-coding (unknown [101.227.46.166]) by gzga-smtp-mtada-g1-2 (Coremail) with SMTP id _____wD3v2a8lx1nU9BuDg--.20185S3; Sun, 27 Oct 2024 09:30:37 +0800 (CST) From: Andy Fan To: Dean Rasheed Cc: Japin Li , Jim Jones , Postgres hackers Subject: Re: New function normal_rand_array function to contrib/tablefunc. In-Reply-To: (Dean Rasheed's message of "Sat, 26 Oct 2024 11:39:34 +0100") References: <87plssezpc.fsf@163.com> <87v814wmz0.fsf@163.com> <87plpv1rb0.fsf@163.com> <87le0iqrsu.fsf@163.com> <87zfox2rx7.fsf@163.com> <87ed68gcym.fsf@163.com> <87zfmru1oi.fsf@163.com> Date: Sun, 27 Oct 2024 09:30:36 +0800 Message-ID: <874j4yl4cj.fsf@163.com> MIME-Version: 1.0 Content-Type: text/plain X-CM-TRANSID: _____wD3v2a8lx1nU9BuDg--.20185S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7tFWrGF4fXr13AF4xZry8Grg_yoW8Ar15pa yYkFnF9rZ5JFnIkws0qa4Iva4YkrZ5JFyUXwn7Xr9Fk3s0kFn2qryIgrZ0kas09rsxKFyj vFy2gFW5Ja1rAFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U1nQbUUUUU= X-Originating-IP: [101.227.46.166] X-CM-SenderInfo: x2klx3xlid0iqsrtqiywtou0bp/xtbBZwCFU2cdi8t7cwAAsD List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dean Rasheed writes: > On Sat, 26 Oct 2024 at 01:51, Andy Fan wrote: >> >> > 10). In this error: >> > >> > + elog(ERROR, "unsupported type %d for rand_array function.", >> > + datatype); >> > >> > "datatype" is of type Oid, which is unsigned, and so it should use >> > "%u" not "%d". Also, as above, it should not end with a period, so it >> > should be: >> > >> > + elog(ERROR, "unsupported type %u for rand_array function", >> > + datatype); >> >> All the following commands succeed without any warnings. >> >> clang -O0 -g main.c -o main -Wall -Wformat >> gcc -g main.c -o main -Wall -Wformat >> > > This can be detected in gcc with -Wformat plus -Wformat-signedness > flags. Yes, this one works. I didn't realize we have "-Wformat-signedness" subsection after we already have "-Wformat". I have added this one into my toolset. For recording purpose, clang doesn't support this option until now. > > I see that this has been discussed before (e.g., [1]), but it doesn't > look like those patches were committed, and there are still many such > warnings, if you try compiling postgres with those flags. OK, Thanks for the information. Currently I add the "c/c++-gcc" checker for my c file, it just trigger when I am writting a file. so the warnings in other places probably doesn't bother me. > > [1] > https://www.postgresql.org/message-id/flat/CA%2BhUKGJ7EQm9extQAgrFZNNUKqRT8Vv5t1tKqA-5nEcYn0%2BwNA%40mail.gmail.com > > I don't know if anyone has any plans to pick up that work again. I can take that very soon. > but in any case, it seems wise to not add more. Very true. Thank you for all your helps on this series. -- Best Regards Andy Fan