On Mon, Oct 25, 2021 at 12:35:03PM +0100, Jeremie Courreges-Anglas wrote:
> On Mon, Oct 25 2021, Theo Buehler <[email protected]> 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.
I have a working llvm13 here for building zig 0.9.0-dev.
/usr/src/usr.bin/openssl/s_client.c:897:16: error: variable 'pbuf_off' set but
not used [-Werror,-Wunused-but-set-variable]
int pbuf_len, pbuf_off;
^
/usr/src/usr.bin/openssl/s_client.c:897:6: error: variable 'pbuf_len' set but
not used [-Werror,-Wunused-but-set-variable]
int pbuf_len, pbuf_off;
^
> 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?
ok semarie@ for s_client diff
but you could also remove pbuf_off :)
> 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);
> }
--
Sebastien Marie