Re: enable fallthrough warnings on clang

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Jelte Fennema-Nio <postgres@jeltef.nl>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-04-07T14:35:27Z
Lists: pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes:
> On 06.04.26 23:31, Tom Lane wrote:
>> BF member ayu is failing said test:
>> ...
>> I don't know if it's worth catering to this extremely old
>> clang version ...

> But AFAICT, clang 5 and older are completely broken in this regard, 
> because they react to the presence of [[clang::fallthrough]] with a 
> syntax error ("error: expected expression").  Not even clang's own 
> example code[0] works.

Hah, so we'd make it worse not better by adding
[[clang::fallthrough]].  Let's leave well enough alone then.

			regards, tom lane



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Enable -Wimplicit-fallthrough option for clang

  2. Fix additional fallthrough warning

  3. Fix additional fallthrough warnings from clang

  4. test_cplusplusext: Add C++ pg_fallthrough test case

  5. Use fallthrough attribute instead of comment

  6. Remove useless fallthrough annotation