Re: enable fallthrough warnings on clang

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: enable fallthrough warnings on clang
Date: 2026-04-06 21:31:49
Message-ID: 1914806.1775511109@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> I have committed this patch set. I also added a test into the C++ module.

BF member ayu is failing said test:

ccache clang++-4.0 -std=gnu++11 -Wall -Wpointer-arith -Werror=vla -Wmissing-format-attribute -Wimplicit-fallthrough -Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -I. -I. -I../../../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -c -o test_cplusplusext.o test_cplusplusext.cpp
test_cplusplusext.cpp:66:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case 2:
^
test_cplusplusext.cpp:66:3: note: insert '[[clang::fallthrough]];' to silence this warning
case 2:
^
[[clang::fallthrough]];
test_cplusplusext.cpp:66:3: note: insert 'break;' to avoid fall-through
case 2:
^
break;
1 warning generated.

I don't know if it's worth catering to this extremely old
clang version ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Jackson 2026-04-06 21:39:38 Re: Add http connection service file functionality
Previous Message Tom Lane 2026-04-06 21:19:51 Re: Enable -Wstrict-prototypes and -Wold-style-definition by default