Skip to content

Fix GCC 15+ build warnings on Ubuntu 26.04#8604

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/resolve-build-warnings-citus
Open

Fix GCC 15+ build warnings on Ubuntu 26.04#8604
Copilot wants to merge 3 commits into
mainfrom
copilot/resolve-build-warnings-citus

Conversation

Copilot AI commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

GCC ≥ 15 (Ubuntu 26.04) emits warnings building Citus due to stricter const-correctness on strrchr/bsearch and the new -Wunterminated-string-initialization check.

Description

Resolves four compiler warnings without behavioral change:

  • -Wdiscarded-qualifiers on strrchr (cdc_decoder_utils.c, worker_data_fetch_protocol.c): store the result in a const char *. The pointer is only read, incremented, and passed to strtoull/strtou64 (first arg is const char *).
  • -Wdiscarded-qualifiers on bsearch (citus_safe_lib.c): explicitly cast the return to void *. Plain cast chosen over unconstify(), whose StaticAssert fails on older compilers where bsearch returns non-const void *.
  • -Wunterminated-string-initialization (multi_copy.c): mark BinarySignature[11] (intentionally non-NUL-terminated, 11 bytes) with pg_attribute_nonstring.
  • Portability (pg_version_compat.h): add a pg_attribute_nonstring fallback, since the macro only exists in PostgreSQL 18+; guarded by __has_attribute(nonstring) so it degrades to a no-op where unsupported.
static const char BinarySignature[11] pg_attribute_nonstring = "PGCOPY\n\377\r\n\0";

Copilot AI changed the title [WIP] Fix build warnings for Citus on Ubuntu 26.04 with GCC >= 15 Fix GCC 15+ build warnings on Ubuntu 26.04 Jun 1, 2026
Copilot AI requested a review from ihalatci June 1, 2026 18:48
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.73%. Comparing base (efa65fc) to head (a5ec1e3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8604      +/-   ##
==========================================
- Coverage   88.73%   88.73%   -0.01%     
==========================================
  Files         288      288              
  Lines       64384    64385       +1     
  Branches     8108     8109       +1     
==========================================
- Hits        57133    57130       -3     
- Misses       4909     4913       +4     
  Partials     2342     2342              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ihalatci ihalatci marked this pull request as ready for review June 13, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnings when building citus on ubuntu 26.04 with gcc >= 15

2 participants