Skip to content

fix undefined type error, undefined type ‘struct passwd’#8

Open
evadnoob wants to merge 1 commit intomarkwkm:mainfrom
evadnoob:main
Open

fix undefined type error, undefined type ‘struct passwd’#8
evadnoob wants to merge 1 commit intomarkwkm:mainfrom
evadnoob:main

Conversation

@evadnoob
Copy link
Copy Markdown

2.754 src/pg_proctab.c:333:73: error: invalid use of undefined type ‘struct passwd’
2.754 333 | values[i_username] = (char *) palloc((strlen(pwd->pw_name) +
2.754 | ^~
2.756 src/pg_proctab.c:335:55: error: invalid use of undefined type ‘struct passwd’
2.756 335 | strcpy(values[i_username], pwd->pw_name);
2.756 | ^~
2.919 make: *** [: src/pg_proctab.o] Error 1

2.754 src/pg_proctab.c:333:73: error: invalid use of undefined type ‘struct passwd’
2.754   333 |                         values[i_username] = (char *) palloc((strlen(pwd->pw_name) +
2.754       |                                                                         ^~
2.756 src/pg_proctab.c:335:55: error: invalid use of undefined type ‘struct passwd’
2.756   335 |                         strcpy(values[i_username], pwd->pw_name);
2.756       |                                                       ^~
2.919 make: *** [<builtin>: src/pg_proctab.o] Error 1
@markwkm
Copy link
Copy Markdown
Owner

markwkm commented Jul 2, 2025

I wasn't able to reproduce that compiler error in my Gentoo environment against commit 2fba2ba3003ca7a6a2787abd5c7eff286002157a. I'm wondering if that might be distro specific? Can you offer any details and I can try to reproduce?

% USE_PGXS=1 make
cp sql/pg_proctab.sql sql/pg_proctab--0.0.13.sql
x86_64-pc-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -march=native -O2 -pipe -fno-omit-frame-pointer -std=gnu17 -fPIC -fvisibility=hidden -I. -I./ -I/usr/include/postgresql-17/server -I/usr/include/postgresql-17/internal  -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/pg_proctab.o src/pg_proctab.c
x86_64-pc-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -march=native -O2 -pipe -fno-omit-frame-pointer -std=gnu17 -fPIC -fvisibility=hidden src/pg_proctab.o -L/usr/lib64/postgresql-17/lib64 -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs  -Wl,--as-needed -Wl,-rpath,'/usr/lib64/postgresql-17/lib64',--enable-new-dtags -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -fvisibility=hidden -shared -o src/pg_proctab.so

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