[evince] synctex: Annotate functions that wrap vfprintf



commit eaa0c41c8a05f7d7a154cdee491d3287fb0131c5
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Thu Aug 2 16:16:44 2018 -0400

    synctex: Annotate functions that wrap vfprintf
    
    Annotate both _syntex_log and _synctex_error that wrap
    vfprintf directly and indirectly, respectively. Thus, we
    should let the compiler know we that these functions receive
    a formatting variable with a variable number of arguments.
    
    Fixes #562

 cut-n-paste/synctex/synctex_parser_utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/cut-n-paste/synctex/synctex_parser_utils.c b/cut-n-paste/synctex/synctex_parser_utils.c
index 6580d389..08053f02 100644
--- a/cut-n-paste/synctex/synctex_parser_utils.c
+++ b/cut-n-paste/synctex/synctex_parser_utils.c
@@ -87,7 +87,8 @@ void _synctex_free(void * ptr) {
 #   include <syslog.h>
 #endif
 
-int _synctex_log(int level, const char * prompt, const char * reason,va_list arg);
+int _synctex_error(const char * reason, ...) __attribute__((__format__ (__printf__, 1, 2)));
+int _synctex_log(int level, const char * prompt, const char * reason, va_list arg) __attribute__((__format__ 
(__printf__, 3, 0)));
 
 int _synctex_log(int level, const char * prompt, const char * reason,va_list arg) {
        int result;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]