gcc -ftabstop option

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: gcc -ftabstop option
Date: 2022-06-21 10:49:24
Message-ID: 7d11adc5-2046-f29a-7f37-0f45f5093879@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I suggest that we add the gcc (also clang) option -ftabstop=4.

This has two effects: First, it produces more accurate column numbers
in compiler errors and correctly indents the code excerpts that the
compiler shows with those. Second, it enables the compiler's detection
of confusingly indented code to work more correctly. (But the latter is
only a potential problem for code that does not use tabs for
indentation, so it would be mostly a help during development with sloppy
editor setups.)

Attached is a patch to discover the option in configure.

One bit of trickery not addressed yet is that we might want to strip out
the option and not expose it through PGXS, since we don't know what
whitespacing rules external code uses.

Thoughts?

Attachment Content-Type Size
0001-Add-compiler-option-ftabstop-4-if-available.patch text/plain 2.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-06-21 10:51:38 Re: Use fadvise in wal replay
Previous Message Jakub Wartak 2022-06-21 10:32:48 RE: Use fadvise in wal replay