Re: Patch a potential memory leak in describeOneTableDetails() - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Patch a potential memory leak in describeOneTableDetails()
Date
Msg-id BDE54C55-438C-48E9-B2A3-08EB3A0CBB9F@yesql.se
Whole thread Raw
In response to Re: Patch a potential memory leak in describeOneTableDetails()  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
> On 22 Feb 2022, at 07:14, Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote:

> Anyway, don't we use the -ftabstop option flag to silence compiler?
> The warning is contradicting our convention. The attached adds that
> flag.

Isn't this flag contradicting our convention?  From the docs section you
reference further down:

    "Source code formatting uses 4 column tab spacing, with tabs preserved
    (i.e., tabs are not expanded to spaces)."

The -ftabstop option is (to a large extent, not entirely) to warn when tabs and
spaces are mixed creating misleading indentation that the author didn't even
notice due to tabwidth settings?  ISTM we are better of getting these warnings
than suppressing them.

> By the way, the doc says that:
>
> https://www.postgresql.org/docs/14/source-format.html
>
>> The text browsing tools more and less can be invoked as:
>>   more -x4
>>   less -x4
>> to make them show tabs appropriately.
>
> But AFAICS the "more" command on CentOS doesn't have -x options nor
> any option to change tab width and I don't find a document that
> suggests its existence on other platforms.

macOS, FreeBSD and NetBSD both show the less(1) manpage for more(1) which
suggests that more is implemented using less there, and thus supports -x (it
does on macOS).  OpenBSD and Solaris more(1) does not show a -x option, but AIX
does have it.  Linux in its various flavors doesn't seem to have it.

The section in question was added to our docs 22 years ago, to make it reflect
the current operating systems in use maybe just not mentioning more(1) is the
easiest?:

    "The text browsing tool less can be invoked as less -x4 to make it show
    tabs appropriately."

Or perhaps remove that section altogether?

--
Daniel Gustafsson        https://vmware.com/




pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Add checkpoint and redo LSN to LogCheckpointEnd log message
Next
From: Andres Freund
Date:
Subject: Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To: