On Mon, Oct 25 2021, Theo Buehler <t...@theobuehler.org> wrote: >> index 664a5200037..e33763e7420 100644 >> --- a/usr.bin/openssl/Makefile >> +++ b/usr.bin/openssl/Makefile >> @@ -17,6 +17,7 @@ CFLAGS+= -Wuninitialized >> CFLAGS+= -Wunused >> .if ${COMPILER_VERSION:L} == "clang" >> CFLAGS+= -Werror >> +CFLAGS+= -Wno-unused-but-set-variable > > This will break the build with LLVM 11 because of -Werror: > > error: unknown warning option '-Wno-unused-but-set-variable'; did you mean > '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option] > *** Error 1 in /usr/src/usr.bin/openssl (<sys.mk>:87 'apps.o') > > Also, it would be nice to know what triggered this addition.
You can use egcc to spot why clang 13 errors out, but they may not warn exactly about the same problems. This works for easy stuff, not so much for the kernel. We really need the clang 13 errors. Here's an attempt to use egcc over openssl and libcrypto. The s_client diff probably fixes what clang 13 complains about. The two latter diffs for libcrypto remove unneeded includes. This looks unrelated to the addition of -Wno-unused-but-set-variable by mortimer@, but I thought maybe you would be interested. egcc -Wno-unused-but-set-variable doesn't seem to find anything else in libcrypto. In file included from /usr/src/lib/libcrypto/x509/x509_asid.c:28: /usr/src/lib/libcrypto/x509/ext_dat.h:81:33: error: 'standard_exts' defined but not used [-Werror=unused-variable] static const X509V3_EXT_METHOD *standard_exts[] = { ok for the s_client diff? Your call regarding the 2nd & 3rd. If that structure really can be used in multiple files then "static" is probably not appropriate. Or maybe the structure should just be moved to x509/x509_lib.c. Index: usr.bin/openssl/s_client.c =================================================================== RCS file: /home/cvs/src/usr.bin/openssl/s_client.c,v retrieving revision 1.55 diff -u -p -r1.55 s_client.c --- usr.bin/openssl/s_client.c 22 Oct 2021 09:44:58 -0000 1.55 +++ usr.bin/openssl/s_client.c 25 Oct 2021 10:53:06 -0000 @@ -894,7 +894,6 @@ s_client_main(int argc, char **argv) char *cbuf = NULL, *sbuf = NULL, *mbuf = NULL, *pbuf = NULL; int cbuf_len, cbuf_off; int sbuf_len, sbuf_off; - int pbuf_len; int full_log = 1; char *pass = NULL; X509 *cert = NULL; @@ -1195,7 +1194,6 @@ s_client_main(int argc, char **argv) cbuf_off = 0; sbuf_len = 0; sbuf_off = 0; - pbuf_len = 0; /* This is an ugly hack that does a lot of assumptions */ /* @@ -1502,7 +1500,6 @@ s_client_main(int argc, char **argv) if (SSL_get_error(con, p) == SSL_ERROR_NONE) { if (p <= 0) goto end; - pbuf_len = p; k = SSL_read(con, sbuf, p); } Index: lib/libcrypto/x509/x509_addr.c =================================================================== RCS file: /home/cvs/src/lib/libcrypto/x509/x509_addr.c,v retrieving revision 1.16 diff -u -p -r1.16 x509_addr.c --- lib/libcrypto/x509/x509_addr.c 8 Sep 2021 10:49:34 -0000 1.16 +++ lib/libcrypto/x509/x509_addr.c 25 Oct 2021 11:09:00 -0000 @@ -23,8 +23,6 @@ #include <openssl/x509.h> #include <openssl/x509v3.h> -#include "ext_dat.h" - #ifndef OPENSSL_NO_RFC3779 /* Index: lib/libcrypto/x509/x509_asid.c =================================================================== RCS file: /home/cvs/src/lib/libcrypto/x509/x509_asid.c,v retrieving revision 1.16 diff -u -p -r1.16 x509_asid.c --- lib/libcrypto/x509/x509_asid.c 8 Sep 2021 09:49:24 -0000 1.16 +++ lib/libcrypto/x509/x509_asid.c 25 Oct 2021 11:09:17 -0000 @@ -25,8 +25,6 @@ #include <openssl/x509.h> #include <openssl/x509v3.h> -#include "ext_dat.h" - #ifndef OPENSSL_NO_RFC3779 static const ASN1_TEMPLATE ASRange_seq_tt[] = { -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE