aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-09-15 08:54:56 +0000
committerGuy Harris <guy@alum.mit.edu>2005-09-15 08:54:56 +0000
commit3d2efed25417391e3f726ca7174a64564a46c6d2 (patch)
tree5f2a594c0ed44f875da2534035f593d702fb8046
parent7cc2d21bc7c56a0fb04ed72af23c99256615b085 (diff)
Tag ep_strdup_printf() and se_strdup_printf() as printf-like functions,
so we get compile-time checking of arguments when possible. svn path=/trunk/; revision=15813
-rw-r--r--epan/emem.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/emem.h b/epan/emem.h
index 00e584f38b..81f2307294 100644
--- a/epan/emem.h
+++ b/epan/emem.h
@@ -26,6 +26,8 @@
#ifndef __EMEM_H__
#define __EMEM_H__
+#include "gnuc_format_check.h"
+
/* Functions for handling memory allocation and garbage collection with
* a packet lifetime scope.
* These functions are used to allocate memory that will only remain persistent
@@ -58,7 +60,8 @@ gchar* ep_strndup(const gchar* src, size_t len);
guint8* ep_memdup(const guint8* src, size_t len);
/* Create a formated string with a packet lifetime scope */
-gchar* ep_strdup_printf(const gchar* fmt, ...);
+gchar* ep_strdup_printf(const gchar* fmt, ...)
+ GNUC_FORMAT_CHECK(printf, 1, 2);
/* allocates with a packet lifetime scope an array of type made of num elements */
#define ep_alloc_array(type,num) (type*)ep_alloc(sizeof(type)*(num))
@@ -110,7 +113,8 @@ gchar* se_strndup(const gchar* src, size_t len);
guint8* se_memdup(const guint8* src, size_t len);
/* Create a formated string with a capture lifetime scope */
-gchar* se_strdup_printf(const gchar* fmt, ...);
+gchar* se_strdup_printf(const gchar* fmt, ...)
+ GNUC_FORMAT_CHECK(printf, 1, 2);
/* allocates with a capture lifetime scope an array of type made of num elements */
#define se_alloc_array(type,num) (type*)se_alloc(sizeof(type)*(num))