apache / apache/age

PG19: error: expected identifier or ‘(’ before ‘void’

Open
#2,478 4 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
C
Stars
4.8k
Forks
523
Avg merge
1d 2h
Merged PRs (30d)
9

Description

The PG19/v1.8.0-rc0 doesn't work with PG 19 beta 2:

```
x86_64-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wmissing-format-attribute -Wold-style-declaration -Wimplicit-fallthrough=5 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -Wmissing-variable-declarations -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fno-omit-frame-pointer -Wstrict-prototypes -Wold-style-definition -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/home/myon/projects/postgresql/postgresql-age/postgresql-age=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fPIC -fvisibility=hidden -MMD -MP -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/include/postgresql/19/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/backend/utils/graph_generation.o src/backend/utils/graph_generation.c
src/backend/utils/adt/agtype_parser.c:77:1: warning: ‘noreturn’ attribute ignored [-Wattributes]
77 | static pg_noreturn void report_parse_error(agtype_parse_context ctx,
| ^~~~~~
src/backend/utils/adt/agtype_parser.c:77:20: error: expected identifier or ‘(’ before ‘void’
77 | static pg_noreturn void report_parse_error(agtype_parse_context ctx,
| ^~~~
src/backend/utils/adt/agtype_parser.c:79:1: warning: ‘noreturn’ attribute ignored [-Wattributes]
79 | static pg_noreturn void report_invalid_token(agtype_lex_context *lex);
| ^~~~~~
src/backend/utils/adt/agtype_parser.c:79:20: error: expected identifier or ‘(’ before ‘void’
79 | static pg_noreturn void report_invalid_token(agtype_lex_context *lex);
| ^~~~
src/backend/utils/adt/agtype_parser.c: In function ‘lex_expect’:
src/backend/utils/adt/agtype_parser.c:142:9: error: implicit declaration of function ‘report_parse_error’ [-Wimplicit-function-declaration]
142 | report_parse_error(ctx, lex);
| ^~~~~~~~~~~~~~~~~~
src/backend/utils/adt/agtype_parser.c: In function ‘agtype_lex’:
src/backend/utils/adt/agtype_parser.c:633:21: error: implicit declaration of function ‘report_invalid_token’; did you mean ‘report_invalid_encoding’? [-Wimplicit-function-declaration]
633 | report_invalid_token(lex);
| ^~~~~~~~~~~~~~~~~~~~
| report_invalid_encoding
src/backend/utils/adt/agtype_parser.c: At top level:
src/backend/utils/adt/agtype_parser.c:1151:13: warning: conflicting types for ‘report_parse_error’; have ‘void(agtype_parse_context, agtype_lex_context *)’
1151 | static void report_parse_error(agtype_parse_context ctx,
| ^~~~~~~~~~~~~~~~~~
src/backend/utils/adt/agtype_parser.c:1151:13: error: static declaration of ‘report_parse_error’ follows non-static declaration
src/backend/utils/adt/agtype_parser.c:142:9: note: previous implicit declaration of ‘report_parse_error’ with type ‘void(agtype_parse_context, agtype_lex_context *)’
142 | report_parse_error(ctx, lex);
| ^~~~~~~~~~~~~~~~~~
src/backend/utils/adt/agtype_parser.c:1258:13: warning: conflicting types for ‘report_invalid_token’; have ‘void(agtype_lex_context *)’
1258 | static void report_invalid_token(agtype_lex_context *lex)
| ^~~~~~~~~~~~~~~~~~~~
src/backend/utils/adt/agtype_parser.c:1258:13: error: static declaration of ‘report_invalid_token’ follows non-static declaration
src/backend/utils/adt/agtype_parser.c:633:21: note: previous implicit declaration of ‘report_invalid_token’ with type ‘void(agtype_lex_context *)’
633 | report_invalid_token(lex);
| ^~~~~~~~~~~~~~~~~~~~
src/backend/utils/adt/agtype_parser.c:1258:13: warning: ‘report_invalid_token’ defined but not used [-Wunused-function]
1258 | static void report_invalid_token(agtype_lex_context *lex)
| ^~~~~~~~~~~~~~~~~~~~
src/backend/utils/adt/agtype_parser.c:1151:13: warning: ‘report_parse_error’ defined but not used [-Wunused-function]
1151 | static void report_parse_error(agtype_parse_context ctx,
| ^~~~~~~~~~~~~~~~~~
```

(Debian unstable amd64, gcc 15.3)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the PG19 beta 2 build on Debian unstable with GCC 15.3 and inspect src/backend/utils/adt/agtype_parser.c, especially the pg_noreturn declarations and the related function definitions. Done means the extension compiles successfully without the reported declaration errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, postgresql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.