Skip to content

mount.ceph,test: fix -Werror build with clang 21 and glibc 2.43 - #73722

Open
Doracly wants to merge 3 commits into
ceph:mainfrom
Doracly:clang-Werror-fixes
Open

Doracly wants to merge 3 commits into
ceph:mainfrom
Doracly:clang-Werror-fixes

Conversation

@Doracly

@Doracly Doracly commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes three errors in a clang 21 -Werror build on Ubuntu 26.04 (glibc 2.43). CI doesn't see them: make check uses clang 19 and glibc 2.35, builds only the tests target, and uses -Werror for C++ only.

  • mount.ceph: with _GNU_SOURCE, glibc 2.43 returns const char * from strstr() and strchr() for a const argument, so clang and gcc reject assigning the result to char *. The pointers into the device string are now const, and parse_options() takes the writable optarg. A missing -o is marked by NULL instead of the address of EMPTY_STRING, which is dropped; behaviour is unchanged.
  • test/fs: test_trim_caps writes an uninitialized byte to a pipe (-Wuninitialized-const-pointer, new in clang 21).
  • test/rgw: test_d4n_filter captures two variables it never uses (-Wunused-lambda-capture). ceph_test_rgw_d4n_filter isn't part of the tests target, so CI never compiles it.

No functional change.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

With _GNU_SOURCE, glibc 2.43 returns const char * from strstr() and
strchr() for a const string, so assigning the result to char * fails
with -Werror on clang and gcc.

Make the pointers into dev_str const. parse_options() writes into its
argument, so pass it the non-const optarg. A missing -o was marked by
the address of the const EMPTY_STRING; the now non-const opts uses
NULL instead, so drop EMPTY_STRING.

Assisted-by: claude-opus-5-5
Signed-off-by: Dominik Raddatz <dominik.raddatz@clyso.com>
The parent writes buf to the pipe without setting it, which clang 21
reports with -Wuninitialized-const-pointer. The child only waits for
the byte, so any value works.

Assisted-by: claude-opus-5-5
Signed-off-by: Dominik Raddatz <dominik.raddatz@clyso.com>
BucketRemoveDeleteMarker declares and captures instance_2 and
instance_3 but never uses them, which clang reports with
-Wunused-lambda-capture.

Assisted-by: claude-opus-5-5
Signed-off-by: Dominik Raddatz <dominik.raddatz@clyso.com>
@Doracly
Doracly requested review from a team as code owners November 10, 2026 11:37
@github-actions github-actions Bot added cephfs Ceph File System rgw tests labels Nov 10, 2026
@Doracly

Doracly commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@tchaikov @batrick @cbodley small fixes for a clang 21 -Werror build with glibc 2.43, no functional change. mount.ceph and test/fs are CephFS, test/rgw is RGW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System rgw tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants