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

ocsp.c:190:29: error: passing argument 1 of PEM_ASN1_read_bio from incompatible pointer type #305

Open
ConiKost opened this issue Jan 5, 2024 · 3 comments
Labels

Comments

@ConiKost
Copy link

ConiKost commented Jan 5, 2024

  • uname -a or OS info: Gentoo Linux (Kernel 6.6.9)

  • openssl version or OPENSSL_VERSION_TEXT in your opensslv.h: OpenSSL 3.1.4 24 Oct 2023 (Library: OpenSSL 3.1.4 24 Oct 2023)

  • lua -v or luajit -v: Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio

Problem details
Using GCC14 and newer makes compilation fail. GCC14 sets -Wincompatible-pointer-types as fatal error. As a result, the compilation will fail with lua-openssl.

Steps/codes to reproduce the bug

  1. Use GCC14
  2. Compile lua-openssl

Expected result
Compilation succeeds

Additional context

x86_64-pc-linux-gnu-gcc -O2 -march=x86-64 -pipe -pipe -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -fPIC  -O2 -march=x86-64 -pipe -pipe -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -I/usr/include/luajit-2.1  -Wall -Wno-unused-value -Wno-unused-function -Ideps -Ideps/lua-compat/c-api -Ideps/auxiliar -c -o src/xalgor.o src/xalgor.c
src/ocsp.c: In function ‘openssl_ocsp_request_read’:
src/ocsp.c:190:29: error: passing argument 1 of ‘PEM_ASN1_read_bio’ from incompatible pointer type [-Wincompatible-pointer-types]
  190 |   OCSP_REQUEST *req = pem ? PEM_read_bio_OCSP_REQUEST(bio, NULL, NULL)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                             |
      |                             char * (*)()
In file included from src/openssl.h:23,
                 from src/ocsp.c:16:
/usr/include/openssl/pem.h:391:38: note: expected ‘void * (*)(void **, const unsigned char **, long int)’ but argument is of type ‘char * (*)()’
  391 | void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
      |                         ~~~~~~~~~~~~~^~~
src/ocsp.c:190:29: error: passing argument 4 of ‘PEM_ASN1_read_bio’ from incompatible pointer type [-Wincompatible-pointer-types]
  190 |   OCSP_REQUEST *req = pem ? PEM_read_bio_OCSP_REQUEST(bio, NULL, NULL)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                             |
      |                             char **
/usr/include/openssl/pem.h:391:77: note: expected ‘void **’ but argument is of type ‘char **’
  391 | void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
      |                                                                      ~~~~~~~^
src/ocsp.c: In function ‘openssl_ocsp_response_read’:
src/ocsp.c:366:30: error: passing argument 1 of ‘PEM_ASN1_read_bio’ from incompatible pointer type [-Wincompatible-pointer-types]
  366 |   OCSP_RESPONSE *res = pem ? PEM_read_bio_OCSP_RESPONSE(bio, NULL, NULL)
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              char * (*)()
/usr/include/openssl/pem.h:391:38: note: expected ‘void * (*)(void **, const unsigned char **, long int)’ but argument is of type ‘char * (*)()’
  391 | void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
      |                         ~~~~~~~~~~~~~^~~
src/ocsp.c:366:30: error: passing argument 4 of ‘PEM_ASN1_read_bio’ from incompatible pointer type [-Wincompatible-pointer-types]
  366 |   OCSP_RESPONSE *res = pem ? PEM_read_bio_OCSP_RESPONSE(bio, NULL, NULL)
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              char **
/usr/include/openssl/pem.h:391:77: note: expected ‘void **’ but argument is of type ‘char **’
  391 | void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,
      |                                                                      ~~~~~~~^
@ConiKost
Copy link
Author

@zhaozg This will be a hard issue with GCC14, as GCC14 by default does now error on -Wincompatible-pointer-types.

@zhaozg zhaozg added the upstream label Apr 5, 2024
@rdw-software
Copy link
Contributor

The library should again compile with GCC 14 as of bfeedbe.

@ConiKost
Copy link
Author

Thanks!

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

No branches or pull requests

3 participants