Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fluent-bit 3.0.3+ fails to build with -Wincompatible-pointer-types and -Wpointer-sign #8858

Closed
j0057 opened this issue May 22, 2024 · 6 comments · Fixed by #8901
Closed

fluent-bit 3.0.3+ fails to build with -Wincompatible-pointer-types and -Wpointer-sign #8858

j0057 opened this issue May 22, 2024 · 6 comments · Fixed by #8901

Comments

@j0057
Copy link

j0057 commented May 22, 2024

Bug Report

Describe the bug

When building the fluent-bit AUR package for versions 3.0.3 or 3.0.4 on Archlinux, the build fails with these errors:

/build/fluent-bit/src/src/tls/openssl.c:220:40: error: passing argument 1 of ‘SSL_select_next_proto’ from incompatible pointer type [-Wincompatible-pointer-types]
/usr/include/openssl/ssl.h:828:50: note: expected ‘unsigned char **’ but argument is of type ‘const unsigned char **’
/build/fluent-bit/src/src/tls/openssl.c:222:40: warning: pointer targets in passing argument 3 of ‘SSL_select_next_proto’ differ in signedness [-Wpointer-sign]
/usr/include/openssl/ssl.h:829:55: note: expected ‘const unsigned char *’ but argument is of type ‘char *’

This is code introduced in commits 1feb741 and 5340b4c.

Is the intention to be able to build with -Wincompatible-pointer-types and -Wpointer-sign, or should I relax the build options for the fluent-bit AUR package?

To Reproduce

  • Clone the fluent-bit AUR package
  • Build on Archlinux with extra-x86_64-build

Your Environment

  • Version used: 3.0.3, 3.0.4
  • Configuration: -
  • Environment name and version (e.g. Kubernetes? What version?): -
  • Server type and version: -
  • Operating System and version: Archlinux, with openssl 3.3.0-1
  • Filters and plugins: -

Additional context

N/A

@j0057
Copy link
Author

j0057 commented May 24, 2024

Update:

After patching the code to prevent the warnings, the build fails on other warnings, a -Wformat in plugins/kubernetes_events/kubernetes_events.c.

I can't build 3.0.2 either, this used to work before, but in the log file of an earlier build of 3.0.2, the -Wincompatible-pointer-types and -Wpointer-sign warnings were already there, without failing the build. Something must have changed in Archlinux itself.

I'll keep investigating...

@Javex
Copy link
Contributor

Javex commented May 31, 2024

@j0057 could this be due to an upgrade of GCC to 14.1? https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors

Type checking on pointer types (-Werror=incompatible-pointer-types)
GCC no longer allows implicitly casting all pointer types to all other pointer types. This behavior is now restricted to the void * type and its qualified variations. 

I checked with 13.2 and the program still compiles, from 14.1 this warning is now an error so compilation fails.

@j0057
Copy link
Author

j0057 commented May 31, 2024

Yes, that must be it! My last successful builds were on GCC 13.2.

@Javex
Copy link
Contributor

Javex commented Jun 1, 2024

I've made a PR here that might be able to fix it: #8901. If nothing else you could probably turn that into a patch for the package to fix it until it's sorted out upstream.

@awcator
Copy link

awcator commented Jun 5, 2024

Javex changes are working fine in latest Arch

@j0057
Copy link
Author

j0057 commented Jun 6, 2024

Thank you @Javex and @edsiper!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants