In a Yocto (cross-compile) build, using gcc-12.2, when building with DEBUG_OPTIMIZATION, I see:
../../git/src/relpsess.c:95:1: error: inlining failed in call to 'relpSessFreePermittedPeers': function not considered for inlining
[-Werror=inline]
95 | relpSessFreePermittedPeers(relpSess_t *const pThis)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/src/relpsess.c:1036:9: note: called from here
1036 | relpSessFreePermittedPeers(pThis);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Adding the following:
DEBUG_OPTIMIZATION:append = " -Wno-error=inline"
works around the compile failure and rsyslog passes it's tests as you'd hope.
Using the git tree and:
make -C src librelp_la-relpsess.lo CFLAGS=" -Winline -Werror -Og "
I was not able to reproduce the error when compiling natively using Ubuntu-22.04 (gcc-11.3) but
was able to reproduce it using Fedora-37, gcc --version : gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
Oh and it only happens when using -Og not -O[0-3]
I suspect that this is a toolchain bug rather than a librelp bug. Do you agree?
In a Yocto (cross-compile) build, using gcc-12.2, when building with DEBUG_OPTIMIZATION, I see:
Adding the following: DEBUG_OPTIMIZATION:append = " -Wno-error=inline" works around the compile failure and rsyslog passes it's tests as you'd hope.
Using the git tree and: make -C src librelp_la-relpsess.lo CFLAGS=" -Winline -Werror -Og " I was not able to reproduce the error when compiling natively using Ubuntu-22.04 (gcc-11.3) but was able to reproduce it using Fedora-37, gcc --version : gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
Oh and it only happens when using -Og not -O[0-3]
I suspect that this is a toolchain bug rather than a librelp bug. Do you agree?