Skip to content

Fix C parser compiler warnings - #5721

Merged
rmosolgo merged 1 commit into
rmosolgo:masterfrom
ydah:fix-c-parser-function-prototypes
Aug 29, 2026
Merged

Fix C parser compiler warnings#5721
rmosolgo merged 1 commit into
rmosolgo:masterfrom
ydah:fix-c-parser-function-prototypes

Conversation

@ydah

@ydah ydah commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The C parser currently declares and defines several no-argument functions using empty parameter lists:

void Init_graphql_c_parser_ext() {

In C, () leaves the parameters unspecified and GCC reports these definitions with -Wold-style-definition:

warning: old-style function definition [-Wold-style-definition]

The parser's yyerror function always raises through rb_exc_raise, but it is not declared as non-returning, which produces an additional compiler warning.

This PR updates the no-argument declarations and definitions to use (void) and marks yyerror with Ruby's portable NORETURN macro. The Ragel and Bison source files and their generated C files are updated together.

There is no runtime behavior change.

@rmosolgo rmosolgo added this to the 2.6.11 milestone Aug 29, 2026
@rmosolgo

Copy link
Copy Markdown
Owner

Thanks!

@rmosolgo
rmosolgo merged commit 3106094 into rmosolgo:master Aug 29, 2026
19 of 27 checks passed
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