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-06T21:31:49Z
Lists: pgsql-hackers
Peter Eisentraut <peter@eisentraut.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
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Enable -Wimplicit-fallthrough option for clang
- 0284e07599a5 19 (unreleased) landed
-
Fix additional fallthrough warning
- 3f7a0e1e55ef 19 (unreleased) landed
-
Fix additional fallthrough warnings from clang
- 3a63b76571ba 19 (unreleased) landed
-
test_cplusplusext: Add C++ pg_fallthrough test case
- 2f2c9d836373 19 (unreleased) landed
-
Use fallthrough attribute instead of comment
- 8354b9d6b602 19 (unreleased) landed
-
Remove useless fallthrough annotation
- 0c3fbb3fef1e 19 (unreleased) landed