Created attachment 3040 [details] Add missing includes to openbsd-compat/bsd-err.c gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-strong -fPIE -I. -I.. -I. -I./.. -DHAVE_CONFIG_H -c bsd-err.c bsd-err.c: In function ‘err’: bsd-err.c:37:26: warning: implicit declaration of function ‘strerror’; did you mean ‘hstrerror’? [-Wimplicit-function-declaration] fprintf(stderr, "%s: ", strerror(errno)); ^~~~~~~~ hstrerror bsd-err.c:37:20: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=] fprintf(stderr, "%s: ", strerror(errno)); ~^ ~~~~~~~~~~~~~~~ %d bsd-err.c: In function ‘warn’: bsd-err.c:66:20: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=] fprintf(stderr, "%s: ", strerror(errno)); ~^ ~~~~~~~~~~~~~~~ %d I went through and added all the missing #includes in the attached patch. Some duplicate "includes.h", but it seems to be reasonably common practice in OpenSSH to add direct #includes for symbols that are used directly.
(In reply to Colin Watson from comment #0) > Created attachment 3040 [details] > Add missing includes to openbsd-compat/bsd-err.c Applied, thanks. > I went through and added all the missing #includes in the attached > patch. Some duplicate "includes.h", but it seems to be reasonably > common practice in OpenSSH to add direct #includes for symbols that > are used directly. Current policy is to include system headers in the .c file where they're needed however some of the compat code either needs it earlier, was added prior to the policy or both.
Close all resolved bugs after release of OpenSSH 7.7.