aboutsummaryrefslogtreecommitdiffstats
path: root/meta-gnome/recipes-gnome/bonobo/libbonobo/fix-nonliteral-in-string.patch
blob: 20db671e0552955344f3b7cb34190c838f343cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
This checks whether the format string is a literal on the calling function. As bonobo_debug_print()
takes already a va_list, we specify the format on the functions that call it
The second number, which is 0 here, should then be the argument index of the variadic argument

Fixed warning with clang

| ../../libbonobo-2.32.1/bonobo/bonobo-debug.c:58:32: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
|         vfprintf (_bonobo_debug_file, fmt, args);
|                                       ^~~
| 1 error generated.

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>

Index: libbonobo-2.32.1/bonobo/bonobo-debug.c
===================================================================
--- libbonobo-2.32.1.orig/bonobo/bonobo-debug.c
+++ libbonobo-2.32.1/bonobo/bonobo-debug.c
@@ -47,6 +47,7 @@ bonobo_debug_init(void)
 	  _bonobo_debug_file = stderr;
 }
 
+__attribute__((__format__ (printf, 2, 0)))
 void
 bonobo_debug_print (const char *name, char *fmt, ...)
 {