If sources are compiled under GCC, types of variadic arguments passed
to _synce_log() will be checked against given format string.
Works as usual under other compilers.
--
/Petr4
Index: synce/libsynce/lib/synce_log.h
===================================================================
--- synce/libsynce/lib/synce_log.h (revision 2955)
+++ synce/libsynce/lib/synce_log.h (working copy)
@@ -4,6 +4,11 @@
#include "synce.h"
+/* If we're not using GNU C, elide __attribute__ */
+#ifndef __GNUC__
+# define __attribute__(x) /*NOTHING*/
+#endif
+
#define SYNCE_LOG_LEVEL_LOWEST 0
#define SYNCE_LOG_LEVEL_ERROR 1
@@ -23,7 +28,8 @@
void synce_log_set_level(int level);
void synce_log_use_syslog();
-void _synce_log(int level, const char* file, int line, const char* format, ...);
+void _synce_log(int level, const char* file, int line, const char* format, ...)
+ __attribute__ ((format (printf, 4, 5))); /* Check arguments against format */
#define synce_trace(format, args...) \
_synce_log(SYNCE_LOG_LEVEL_TRACE,__PRETTY_FUNCTION__, __LINE__, format, ##args)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel