lua-openssl
lua-openssl copied to clipboard
ocsp.c:190:29: error: passing argument 1 of PEM_ASN1_read_bio from incompatible pointer type
-
uname -aor OS info: Gentoo Linux (Kernel 6.6.9) -
openssl versionor OPENSSL_VERSION_TEXT in your opensslv.h: OpenSSL 3.1.4 24 Oct 2023 (Library: OpenSSL 3.1.4 24 Oct 2023) -
lua -vorluajit -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
- Use GCC14
- 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,
| ~~~~~~~^
@zhaozg This will be a hard issue with GCC14, as GCC14 by default does now error on -Wincompatible-pointer-types.