Copied from https://github.com/ansemjo/tinyssh-convert/blob/9028c16d99c6ab36aa3e51ac4f3c0b505ebfdff5/utilities.h --- chat.h +++ chat.h @@ -460,3 +460,7 @@ int getopt_config( int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longindex ); + +/* volatile memset to try & avoid optmising it away */ +static void * (* const volatile volatile_memset)(void *, int, size_t) = memset; +#define memzero(ptr, size) volatile_memset(ptr, 0, size) --- configure +++ configure @@ -49,8 +49,7 @@ case "$(uname)" in echo 'OBJS += compat_readpassphrase.o' ;; (Darwin) - cflags -D__STDC_WANT_LIB_EXT1__=1 - cflags "-D'explicit_bzero(b,l)=memset_s((b),(l),0,(l))'" + cflags "-D'explicit_bzero(b,l)=memzero((b),(l))'" config libtls ncursesw defvar OPENSSL_BIN openssl exec_prefix /bin/openssl ;;