Skip to content

src: drop outdated GCC version checks - #71999

Merged
tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-drop-gcc-version-checks
Oct 1, 2026
Merged

tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-drop-gcc-version-checks

Conversation

@tchaikov

@tchaikov tchaikov commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

We require GCC 11 or newer, so some of our __GNUC__ checks are always true with GCC.

heap_profiler.cc and fsx.cc disable -Wformat-truncation only if "GNUC >= 8". Clang sets __GNUC__ to 4, so this check also skips Clang, and we still need that because Clang 16 and 17 do not know this warning. Check for "GCC but not Clang" instead.

libcephfs/test.cc disables -Wdeprecated-declarations only if "GNUC >= 4", which is true for both GCC and Clang. Drop the check, like the other tests that use this pragma.

ceph_assert.h defines __GNUC_PREREQ on FreeBSD, but nothing uses it, so remove it.

The public headers in src/include keep their "GNUC >= 4" checks, because applications may build them with other compilers.

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.

We require GCC 11 or newer, so some of our __GNUC__ checks are always
true with GCC.

heap_profiler.cc and fsx.cc disable -Wformat-truncation only if
"__GNUC__ >= 8". Clang sets __GNUC__ to 4, so this check also skips
Clang, and we still need that because Clang 16 and 17 do not know this
warning. Check for "GCC but not Clang" instead.

libcephfs/test.cc disables -Wdeprecated-declarations only if
"__GNUC__ >= 4", which is true for both GCC and Clang. Drop the check,
like the other tests that use this pragma.

ceph_assert.h defines __GNUC_PREREQ on FreeBSD, but nothing uses it,
so remove it.

The public headers in src/include keep their "__GNUC__ >= 4" checks,
because applications may build them with other compilers.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov requested a review from a team as a code owner September 23, 2026 07:45
@github-actions github-actions Bot added cephfs Ceph File System rbd tests labels Sep 23, 2026

@idryomov idryomov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack from the RBD perspective

Comment thread src/include/ceph_assert.h

#elif defined(__FreeBSD__)
#include <sys/cdefs.h>
#define __GNUC_PREREQ(minor, major) __GNUC_PREREQ__(minor, major)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov tchaikov Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, 9fde4d9 introduced this macro definition to FreeBSD port. back when 9fde4d9 was added, we were still using __GNUC_PREREQ, whose callers was added by 8ba36cd. but we don't have them anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjwithagen do you want to take a look? if no objections, i am about to merge this change.

Comment thread src/test/libcephfs/test.cc Resolved

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libcephfs/test changes look good.

@tchaikov

Copy link
Copy Markdown
Contributor Author

@tchaikov tchaikov self-assigned this Sep 29, 2026
@tchaikov
tchaikov merged commit edb8dfe into ceph:main Oct 1, 2026
22 of 26 checks passed
@tchaikov
tchaikov deleted the wip-drop-gcc-version-checks branch October 1, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants