pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Andy Fan <zhihuifan1213@163.com>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Japin Li <japinli@hotmail.com>
Cc: Jim Jones <jim.jones@uni-muenster.de>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: New function normal_rand_array function to contrib/tablefunc.
Date: Sun, 27 Oct 2024 09:30:36 +0800
Message-ID: <874j4yl4cj.fsf@163.com> (raw )
In-Reply-To: <CAEZATCUP6RF=oXdSxbkOp0iqLh=_SDG4TOhXYpXwHzULKNS8ig@mail.gmail.com >
References: <87plssezpc.fsf@163.com >
<fd1de8c0-467b-4a41-8f7b-0d5122676ecb@uni-muenster.de >
<CAEZATCX_Rd24mS4ScEYV=cLKMoQEJX=+oq40kYbok8rw211W8g@mail.gmail.com >
<87v814wmz0.fsf@163.com >
<CAEZATCUMvnFMiYJbDvk4d1nDdZ8VEqZWOjTUUZZ3itowGyB42w@mail.gmail.com >
<87plpv1rb0.fsf@163.com >
<87le0iqrsu.fsf@163.com >
<ME0P300MB04456793A234B3B1A2B77882B6942@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM >
<87zfox2rx7.fsf@163.com >
<ME0P300MB044589098B6FB20AA771C97DB6952@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM >
<87ed68gcym.fsf@163.com >
<CAEZATCXZt1sUuT4SdZo5vn1rJtm2Rp3UCUsH2YzyBt-vHRXrrQ@mail.gmail.com >
<87zfmru1oi.fsf@163.com >
<CAEZATCUP6RF=oXdSxbkOp0iqLh=_SDG4TOhXYpXwHzULKNS8ig@mail.gmail.com >
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On Sat, 26 Oct 2024 at 01:51, Andy Fan <zhihuifan1213@163.com> 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%4...
>
> 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
view thread (30+ messages) latest in thread
Message-ID: <874j4yl4cj.fsf@163.com>
Permalink: ../874j4yl4cj.fsf@163.com/
Also on: postgresql.org/message-id/874j4yl4cj.fsf@163.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: zhihuifan1213@163.com, dean.a.rasheed@gmail.com, japinli@hotmail.com, jim.jones@uni-muenster.de, pgsql-hackers@lists.postgresql.org
Subject: Re: New function normal_rand_array function to contrib/tablefunc.
In-Reply-To: <874j4yl4cj.fsf@163.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox