Skip to content

Ubuntu 26.04: Fix unittest c23 signatures - #2109

Open
tuhaihe wants to merge 1 commit into
apache:mainfrom
tuhaihe:fix-unittest-c23-signatures
Open

tuhaihe wants to merge 1 commit into
apache:mainfrom
tuhaihe:fix-unittest-c23-signatures

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Oct 10, 2026

Copy link
Copy Markdown
Member

GCC 15 compiles C as C23 by default. In C23, "void f()" means
"void f(void)", and not an unspecified parameter list as before, so a
function defined with empty parentheses no longer converts to a
function pointer type that has parameters. Together with GCC 14 making
-Wincompatible-pointer-types an error, "make unittest-check" fails on
Ubuntu 26.04 in 9 test files:

  error: passing argument 5 of '_will_return' from incompatible pointer
  type [-Wincompatible-pointer-types]
  error: initialization of 'void (*)(void **)' from incompatible
  pointer type 'void (*)(void)'

Give 11 functions the parameter list of the type they are used as:

  • 9 side effect callbacks passed to will_return_with_sideeffect() and
    will_be_called_with_sideeffect(), of type void (*)(void *):
    _ExceptionalCondition (6 files), _errfinish_impl (2 files) and
    RedZoneHandler_DetectRunawaySession_TrackedBytesSanity. None of them
    is called directly. The use of _ExceptionalCondition in
    vmem_tracker_test.c is inside #ifdef USE_ASSERT_CHECKING, so it is
    only compiled in a build with --enable-cassert.
  • 2 cmockery test functions in ginpostinglist_test.c, of type
    void (*)(void **).

Checked on Ubuntu 26.04 (GCC 15.2) with "make -k unittest-check". With
the CI configuration it had 21 errors in 9 files before, and now passes.
With --enable-cassert it has no compile errors, and all unit tests pass.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


GCC 15 compiles C as C23 by default. In C23, "void f()" means
"void f(void)", and not an unspecified parameter list as before, so a
function defined with empty parentheses no longer converts to a
function pointer type that has parameters. Together with GCC 14 making
-Wincompatible-pointer-types an error, "make unittest-check" fails on
Ubuntu 26.04 in 9 test files:

  error: passing argument 5 of '_will_return' from incompatible pointer
  type [-Wincompatible-pointer-types]
  error: initialization of 'void (*)(void **)' from incompatible
  pointer type 'void (*)(void)'

Give 11 functions the parameter list of the type they are used as:
- 9 side effect callbacks passed to will_return_with_sideeffect() and
  will_be_called_with_sideeffect(), of type void (*)(void *):
  _ExceptionalCondition (6 files), _errfinish_impl (2 files) and
  RedZoneHandler_DetectRunawaySession_TrackedBytesSanity. None of them
  is called directly. The use of _ExceptionalCondition in
  vmem_tracker_test.c is inside #ifdef USE_ASSERT_CHECKING, so it is
  only compiled in a build with --enable-cassert.
- 2 cmockery test functions in ginpostinglist_test.c, of type
  void (*)(void **).

Checked on Ubuntu 26.04 (GCC 15.2) with "make -k unittest-check". With
the CI configuration it had 21 errors in 9 files before, and now passes.
With --enable-cassert it has no compile errors, and all unit tests pass.

Assisted-by: Claude Code
Backpatch-through: REL_2_STABLE
@tuhaihe tuhaihe added this to the Ubuntu 26.04 Support milestone Oct 10, 2026
@tuhaihe
tuhaihe enabled auto-merge (rebase) October 10, 2026 05:43
@tuhaihe

tuhaihe commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

This change has been verified in Ubuntu 26.04 on #2096

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.

1 participant