Skip to content

Place pg_noreturn before extern so C23 compilers accept it - #65

Merged
dpage merged 1 commit into
mainfrom
fix/pg-noreturn-c23
Aug 18, 2026
Merged

Place pg_noreturn before extern so C23 compilers accept it#65
dpage merged 1 commit into
mainfrom
fix/pg-noreturn-c23

Conversation

@maqeel75

Copy link
Copy Markdown
Member

Problem

The v1.1-beta1 release run failed on one cell — Package DEB (ubuntu:resolute amd64 pg19):

src/pgedge_vectorizer.h:194:36: error: expected identifier or '(' before 'void'
194 | extern PGDLLEXPORT PGEDGE_NORETURN void pgedge_vectorizer_launcher_main(...)

PGEDGE_NORETURN expands to PostgreSQL's pg_noreturn, which PG19 defines as the C23
[[noreturn]] attribute when __STDC_VERSION__ >= 202311L. C23 only permits an attribute
list at the start of a declaration, so placing it between the storage class and the return
type is a syntax error. Ubuntu resolute ships gcc 15, which defaults to -std=gnu23 — the
only image in the matrix that reaches that branch. PG19's own c.h notes the requirement:
"C23 attributes must be placed at the start of a declaration."

Fix

Move PGEDGE_NORETURN ahead of extern on the two worker entry-point declarations, matching
how PostgreSQL's own headers spell it, and document why the order matters.

Compatibility

No behavior change on any other cell:

  • pg16/17 — no pg_noreturn; PGEDGE_NORETURN is empty and the suffix
    pg_attribute_noreturn() is unchanged.
  • pg18_Noreturn, a C11 function specifier, valid anywhere in the declaration specifiers.
  • pg19 on gcc ≤14 — also _Noreturn; only gcc 15's C23 default produces [[noreturn]].

@maqeel75
maqeel75 requested a review from dpage August 18, 2026 11:58
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 53141f60-55d1-410b-a3e5-1ad79b951aaa

📥 Commits

Reviewing files that changed from the base of the PR and between d50b6bb and 04f3ea8.

📒 Files selected for processing (1)
  • src/pgedge_vectorizer.h

Included review availability: 4 reviews are currently available. Based on recent review activity, included reviews refill at 5 per hour.


📝 Walkthrough

Walkthrough

The header now documents PostgreSQL 18+ pg_noreturn compatibility and C23 attribute-placement requirements. The PGEDGE_NORETURN macro now appears before extern in the launcher and worker declarations. The declarations retain their existing function signatures and suffix attributes.

Merge Risk: ⚪ Minimal · up to 04f3e

This localized header change fixes C23 compilation for the affected build while preserving behavior on other supported PostgreSQL versions; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the C23 compatibility fix in the declarations.
Description check ✅ Passed The description explains the compilation failure, the fix, and compatibility across supported PostgreSQL versions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pg-noreturn-c23

Comment @coderabbitai help to get the list of available commands.

@dpage dpage left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Independently verified: I hit this exact failure packaging v1.1-beta1 (ubuntu:resolute/pg19), traced it to the same root cause, and reproduced both the break and this fix locally with gcc -std=c23. Diff is identical to the fix I'd drafted, plus a nice explanatory comment mine lacked.

@dpage
dpage merged commit 1a804d4 into main Aug 18, 2026
9 checks passed
@dpage
dpage deleted the fix/pg-noreturn-c23 branch August 18, 2026 12:15
dpage added a commit that referenced this pull request Aug 18, 2026
v1.1-beta1's release pipeline failed to build the DEB package for
ubuntu:resolute/pg19 (the only cell on gcc 15, which defaults to C23) and
that failure blocked the entire batched APT publish step, so no
Debian/Ubuntu packages went out for beta1 at all. #65 fixes the
underlying pg_noreturn/C23 attribute-ordering bug; this commit adds the
[1.1-beta2] changelog entry for it.

Release-Date: 2026-08-18
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.

2 participants