Sam James
be19763532
openbsd-compat/bsd-asprintf: add <stdio.h> include for vsnprintf
...
Fixes the following build failure with Clang 15 on musl:
```
bsd-asprintf.c:51:8: error: call to undeclared library function 'vsnprintf' with type 'int (char *, unsigned long, const char *, struct __va_list_tag *)'; ISO C99 and laterclang -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -pipe -Wunknown-warning-option -Qunused-arguments -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -Wmisleading-indentation -Wbitwise-instead-of-logical -fno-strict-aliasing -mretpoline -ftrapv -fzero-call-used-regs=all -fno-builtin-memset -fstack-protector-strong -fPIE -I. -I. -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -DSSHDIR=\"/etc/ssh\" -D_PATH_SSH_PROGRAM=\"/usr/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/lib/misc/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/usr/lib/misc/sftp-server\" -D_PATH_SSH_KEY_SIGN=\"/usr/lib/misc/ssh-keysign\" -D_PATH_SSH_PKCS11_HELPER=\"/usr/lib/misc/ssh-pkcs11-helper\" -D_PATH_SSH_SK_HELPER=\"/usr/lib/misc/ssh-sk-helper\" -D_PATH_SSH_PIDDIR=\"/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DHAVE_CONFIG_H -c cipher-aes.c -o cipher-aes.o
do not support
implicit function declarations [-Wimplicit-function-declaration]
ret = vsnprintf(string, INIT_SZ, fmt, ap2);
^
bsd-asprintf.c:51:8: note: include the header <stdio.h> or explicitly provide a declaration for 'vsnprintf'
1 error generated.
```
2022-09-08 12:04:00 +10:00
Darren Tucker
797cdd9c84
Don't avoid our *sprintf replacements.
...
Don't let systems with broken printf(3) avoid our replacements
via asprintf(3)/vasprintf(3) calling libc internally. From djm@
2018-10-12 16:58:47 +11:00
Darren Tucker
c20dccb561
Strip trailing whitespace.
...
Mechanically strip trailing whitespace on files not synced with OpenBSD
(or in the case of bsd-snprint.c, rsync).
2016-08-02 09:44:25 +10:00
Darren Tucker
5abfb15ced
Move VA_COPY macro into compat header.
...
Some AIX compilers unconditionally undefine va_copy but don't set it back
to an internal function, causing link errors. In some compat code we
already use VA_COPY instead so move the two existing instances into the
shared header and use for sshbuf-getput-basic.c too. Should fix building
with at lease some versions of AIX's compiler. bz#2589, ok djm@
2016-07-15 14:54:16 +10:00
Darren Tucker
60d860e54b
Rollback addition of va_start.
...
va_start was added in 0f754e29dd
, however
it has the wrong number of args and it's not usable in non-variadic
functions anyway so it breaks things (for example Solaris 2.6 as
reported by Tom G. Christensen).i ok djm@
2016-02-17 13:37:09 +11:00
Damien Miller
0f754e29dd
need va_copy before va_start
...
reported by Nicholas Lemonias
2015-10-16 10:53:38 +11:00
Darren Tucker
84287b831e
- (dtucker) [openbsd-compat/bsd-asprintf.c] Plug mem leak in error path.
...
Patch from Jan.Pechanec at sun com.
2007-09-14 10:04:15 +10:00
Damien Miller
be6db83462
- (djm) [bsd-asprintf.c] Better test for bad vsnprintf lengths; ok dtucker@
2006-12-05 22:58:09 +11:00
Darren Tucker
f78fb54412
- (dtucker) [openbsd-compat/{bsd-asprintf.c,bsd-openpty.c,bsd-snprintf.c,
...
glob.c}] Include stdlib.h for malloc and friends in compat code.
2006-08-06 21:25:24 +10:00
Darren Tucker
2eaea99054
- (dtucker) [openbsd-compat/bsd-asprintf.c openbsd-compat/port-aix.c
...
openbsd-compat/rresvport.c] More errno.h.
2006-07-12 23:41:33 +10:00
Damien Miller
57f3915b55
- (djm) [configure.ac openbsd-compat/Makefile.in openbsd-compat/bsd-asprintf.c
...
openbsd-compat/bsd-snprintf.c openbsd-compat/openbsd-compat.h] Add an
asprintf() implementation, after syncing our {v,}snprintf() implementation
with some extra fixes from Samba's version. With help and debugging from
dtucker and tim; ok dtucker@
2005-11-24 19:58:19 +11:00