Annotate warnc/errc for format string checking.diff -r1.1.1.1 -r1.2 src/external/bsd/libarchive/dist/libarchive_fe/err.c
(joerg)
--- src/external/bsd/libarchive/dist/libarchive_fe/err.c 2010/02/20 02:49:07 1.1.1.1
+++ src/external/bsd/libarchive/dist/libarchive_fe/err.c 2014/01/07 02:09:37 1.2
@@ -32,27 +32,27 @@ __FBSDID("$FreeBSD$"); | @@ -32,27 +32,27 @@ __FBSDID("$FreeBSD$"); | |||
32 | #endif | 32 | #endif | |
33 | #include <stdio.h> | 33 | #include <stdio.h> | |
34 | #ifdef HAVE_STDLIB_H | 34 | #ifdef HAVE_STDLIB_H | |
35 | #include <stdlib.h> | 35 | #include <stdlib.h> | |
36 | #endif | 36 | #endif | |
37 | #ifdef HAVE_STRING_H | 37 | #ifdef HAVE_STRING_H | |
38 | #include <string.h> | 38 | #include <string.h> | |
39 | #endif | 39 | #endif | |
40 | 40 | |||
41 | #include "err.h" | 41 | #include "err.h" | |
42 | 42 | |||
43 | const char *lafe_progname; | 43 | const char *lafe_progname; | |
44 | 44 | |||
45 | static void | 45 | static __printflike(2, 0) void | |
46 | lafe_vwarnc(int code, const char *fmt, va_list ap) | 46 | lafe_vwarnc(int code, const char *fmt, va_list ap) | |
47 | { | 47 | { | |
48 | fprintf(stderr, "%s: ", lafe_progname); | 48 | fprintf(stderr, "%s: ", lafe_progname); | |
49 | vfprintf(stderr, fmt, ap); | 49 | vfprintf(stderr, fmt, ap); | |
50 | if (code != 0) | 50 | if (code != 0) | |
51 | fprintf(stderr, ": %s", strerror(code)); | 51 | fprintf(stderr, ": %s", strerror(code)); | |
52 | fprintf(stderr, "\n"); | 52 | fprintf(stderr, "\n"); | |
53 | } | 53 | } | |
54 | 54 | |||
55 | void | 55 | void | |
56 | lafe_warnc(int code, const char *fmt, ...) | 56 | lafe_warnc(int code, const char *fmt, ...) | |
57 | { | 57 | { | |
58 | va_list ap; | 58 | va_list ap; |
--- src/external/bsd/libarchive/dist/libarchive_fe/err.h 2010/02/20 02:49:07 1.1.1.1
+++ src/external/bsd/libarchive/dist/libarchive_fe/err.h 2014/01/07 02:09:37 1.2
@@ -25,17 +25,18 @@ | @@ -25,17 +25,18 @@ | |||
25 | 25 | |||
26 | #ifndef LAFE_ERR_H | 26 | #ifndef LAFE_ERR_H | |
27 | #define LAFE_ERR_H | 27 | #define LAFE_ERR_H | |
28 | 28 | |||
29 | #if defined(__GNUC__) && (__GNUC__ > 2 || \ | 29 | #if defined(__GNUC__) && (__GNUC__ > 2 || \ | |
30 | (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) | 30 | (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) | |
31 | #define __LA_DEAD __attribute__((__noreturn__)) | 31 | #define __LA_DEAD __attribute__((__noreturn__)) | |
32 | #else | 32 | #else | |
33 | #define __LA_DEAD | 33 | #define __LA_DEAD | |
34 | #endif | 34 | #endif | |
35 | 35 | |||
36 | extern const char *lafe_progname; | 36 | extern const char *lafe_progname; | |
37 | 37 | |||
38 | void lafe_warnc(int code, const char *fmt, ...); | 38 | void lafe_warnc(int code, const char *fmt, ...) __printflike(2, 3); | |
39 | void lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD; | 39 | void lafe_errc(int eval, int code, const char *fmt, ...) | |
40 | __LA_DEAD __printflike(3, 4); | |||
40 | 41 | |||
41 | #endif | 42 | #endif |