Using the same script that I successfully build gpgme 1.16.0 under Ubuntu 20.04, I get this under Ubuntu 21.10:
mv -f .deps/import.Tpo .deps/import.Plo
mv -f .deps/gpgconf.Tpo .deps/gpgconf.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../conf -I/usr/local/include -I/usr/local/include -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wno-format-y2k -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-zero-length -Wno-format-truncation -Wno-sizeof-pointer-div -W -Wextra -Wbad-function-cast -Wwrite-strings -Wdeclaration-after-statement -Wformat -Wformat-security -Wpointer-arith -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -fPIC -DPIC -o .libs/error.o
posix-io.c: In function '_gpgme_io_spawn':
**posix-io.c:577:23: error: void value not ignored as it ought to be**
577 | while ((i = closefrom (fd)) && errno == EINTR)
| ^
mv -f .deps/engine-gpgconf.Tpo .deps/engine-gpgconf.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../conf -I/usr/local/include -I/usr/local/include -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wno-format-y2k -Wno-missing-field-initializers -Wno-sign-compare -Wno-format-zero-length -Wno-format-truncation -Wno-sizeof-pointer-div -W -Wextra -Wbad-function-cast -Wwrite-strings -Wdeclaration-after-statement -Wformat -Wformat-security -Wpointer-arith -MT ath.lo -MD -MP -MF .deps/ath.Tpo -c ath.c -fPIC -DPIC -o .libs/ath.o
I suspect this is due to a g++ version bump by Ubuntu, I had some similar problems in my app code with cross-type assignments that used to be warnings becoming errors. This is my build script:
pushd gpgme
./autogen.sh --force
./configure --enable-maintainer-mode
make -j
make check
sudo make install
popd