[evince/gnome-3-36] cut-n-paste: Annotate functions that wraps formatting strings
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/gnome-3-36] cut-n-paste: Annotate functions that wraps formatting strings
- Date: Sat, 30 May 2020 16:13:54 +0000 (UTC)
commit b11e36766289b154669ae6bede1523f5b7b29c95
Author: Germán Poo-Caamaño <gpoo gnome org>
Date: Sat May 30 10:53:10 2020 -0400
cut-n-paste: Annotate functions that wraps formatting strings
clang is stricter than gcc when compiling with -Wformat-nonliteral
and requires annotate the function parameters when passing an
argument to a va_list that contains these arguments.
Fixes #1410
cut-n-paste/synctex/synctex_parser.c | 2 ++
cut-n-paste/synctex/synctex_parser_utils.c | 1 +
cut-n-paste/unarr/common/unarr.c | 1 +
3 files changed, 4 insertions(+)
---
diff --git a/cut-n-paste/synctex/synctex_parser.c b/cut-n-paste/synctex/synctex_parser.c
index 9bbc43dd..fee33d71 100644
--- a/cut-n-paste/synctex/synctex_parser.c
+++ b/cut-n-paste/synctex/synctex_parser.c
@@ -8411,6 +8411,7 @@ struct synctex_updater_t {
int length; /* the number of chars appended */
};
+__attribute__((__format__ (__printf__, 2, 3)))
static int _synctex_updater_print(synctex_updater_p updater, const char * format, ...) {
int result = 0;
if (updater) {
@@ -8447,6 +8448,7 @@ static int vasprintf(char **ret,
/**
* gzvprintf is not available until OSX 10.10
*/
+__attribute__((__format__ (__printf__, 2, 3)))
static int _synctex_updater_print_gz(synctex_updater_p updater, const char * format, ...) {
int result = 0;
if (updater) {
diff --git a/cut-n-paste/synctex/synctex_parser_utils.c b/cut-n-paste/synctex/synctex_parser_utils.c
index 08053f02..3a23532e 100644
--- a/cut-n-paste/synctex/synctex_parser_utils.c
+++ b/cut-n-paste/synctex/synctex_parser_utils.c
@@ -149,6 +149,7 @@ int _synctex_error(const char * reason,...) {
return result;
}
+__attribute__((__format__ (__printf__, 1, 2)))
int _synctex_debug(const char * reason,...) {
va_list arg;
int result;
diff --git a/cut-n-paste/unarr/common/unarr.c b/cut-n-paste/unarr/common/unarr.c
index 97ec92ae..49c6d981 100644
--- a/cut-n-paste/unarr/common/unarr.c
+++ b/cut-n-paste/unarr/common/unarr.c
@@ -92,6 +92,7 @@ size_t ar_get_global_comment(ar_archive *ar, void *buffer, size_t count)
return ar->get_comment(ar, buffer, count);
}
+__attribute__((__format__ (__printf__, 4, 0)))
void ar_log(const char *prefix, const char *file, int line, const char *msg, ...)
{
va_list args;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]