Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
XBT_ATTRIB_PRINTF for vprintf-like functions.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 2 Jun 2021 08:45:13 +0000 (10:45 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 2 Jun 2021 09:37:14 +0000 (11:37 +0200)
include/xbt/misc.h
include/xbt/string.hpp
src/xbt/snprintf.c

index 88d41a7..f81c62a 100644 (file)
@@ -31,7 +31,7 @@ XBT_PUBLIC void sg_version_check(int lib_version_major, int lib_version_minor, i
  *
  * Similar to vasprintf(), but returns a pointer to the newly created string (or aborts on error).
  */
-XBT_PUBLIC char* bvprintf(const char* fmt, va_list ap);
+XBT_PUBLIC char* bvprintf(const char* fmt, va_list ap) XBT_ATTRIB_PRINTF(1, 0);
 /** @brief print to allocated string
  *
  * Similar to asprintf(), but returns a pointer to the newly created string (or aborts on error).
index 2c46f9b..c23e6f0 100644 (file)
@@ -37,7 +37,7 @@ XBT_PUBLIC std::string string_printf(const char* fmt, ...) XBT_ATTRIB_PRINTF(1,
  *
  * @ingroup XBT_str
  */
-XBT_PUBLIC std::string string_vprintf(const char* fmt, va_list ap);
+XBT_PUBLIC std::string string_vprintf(const char* fmt, va_list ap) XBT_ATTRIB_PRINTF(1, 0);
 
 #if SIMGRID_HAVE_MC
 
index 0281701..98bb1c7 100644 (file)
@@ -62,7 +62,7 @@
 #if !HAVE_VASPRINTF
 #include <assert.h>
 #include <stdarg.h> /* vsnprintf */
-int vasprintf(char **ptr, const char *fmt, va_list ap);
+int vasprintf(char** ptr, const char* fmt, va_list ap) XBT_ATTRIB_PRINTF(1, 0);
 int vasprintf(char **ptr, const char *fmt, va_list ap)
 {
   size_t str_m;