Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove PRINTF_STR
authorGabriel Corona <gabriel.corona@enst-bretagne.fr>
Mon, 15 Jun 2015 23:08:27 +0000 (01:08 +0200)
committerGabriel Corona <gabriel.corona@enst-bretagne.fr>
Mon, 15 Jun 2015 23:43:58 +0000 (01:43 +0200)
It was only used in tests.

buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/Cmake/src/internal_config.h.in
src/portable.h
src/xbt/dict.c

index ba8db2b..9ceb7ef 100644 (file)
@@ -661,23 +661,6 @@ endif()
 
 #AC_PROG_MAKE_SET
 
-if(CMAKE_CROSSCOMPILING)
-  set(RUN_PRINTF_NULL_VAR "cross")
-  set(COMPILE_PRINTF_NULL_VAR "cross")
-else()
-  #AC_PRINTF_NULL FIXME: this is too ancient to survive!
-  try_run(RUN_PRINTF_NULL_VAR COMPILE_PRINTF_NULL_VAR
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_printf_null.c
-    )
-endif()
-
-if(RUN_PRINTF_NULL_VAR MATCHES "FAILED_TO_RUN")
-  SET(PRINTF_NULL_WORKING "0")
-else()
-  SET(PRINTF_NULL_WORKING "1")
-endif()
-
 #AC_CHECK_VA_COPY
 
 set(diff_va "va_copy((d),(s))"
index e4ed2e8..a3c0603 100644 (file)
@@ -10,7 +10,6 @@ if(enable_print_message)
   message("need_vasprintf ..............: ${simgrid_need_vasprintf}")
   message("PREFER_PORTABLE_SNPRINTF ....: ${PREFER_PORTABLE_SNPRINTF}")
   message("HAVE_VA_COPY ................: ${HAVE_VA_COPY}")
-  message("PRINTF_NULL_WORKING .........: ${PRINTF_NULL_WORKING}")
   message("")
   message("\#define pth_skaddr_makecontext(skaddr,sksize) (${makecontext_addr})")
   message("\#define pth_sksize_makecontext(skaddr,sksize) (${makecontext_size})")
index 3612538..edfd175 100644 (file)
 /* "enable replacement (v)snprintf if system (v)snprintf is broken" */
 #cmakedefine PREFER_PORTABLE_SNPRINTF @PREFER_PORTABLE_SNPRINTF@
 
-/* Indicates whether printf("%s",NULL) works */
-#cmakedefine PRINTF_NULL_WORKING @PRINTF_NULL_WORKING@
-
 /* define for stack growth */
 #cmakedefine PTH_STACKGROWTH @PTH_STACKGROWTH@
 
index c4caaf9..6e8f6b7 100644 (file)
@@ -108,17 +108,6 @@ extern int asnprintf(char **ptr, size_t str_m, const char *fmt, /*args */
 extern int vasnprintf(char **ptr, size_t str_m, const char *fmt,
                       va_list ap);
 
-/*
- * That's needed to protect solaris's printf from ever seing NULL associated to a %s format
- * (without adding an extra check on working platforms :)
- */
-
-#ifdef PRINTF_NULL_WORKING
-#  define PRINTF_STR(a) (a)
-#else
-#  define PRINTF_STR(a) (a)?:"(null)"
-#endif
-
 /*
  * What we need to extract the backtrace in exception handling code
  */
index d59086b..f43c987 100644 (file)
@@ -678,6 +678,8 @@ void xbt_dict_postexit(void)
 #include "xbt/ex.h"
 #include "portable.h"
 
+#define PRINTF_STR(a) (a)?:"(null)"
+
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_dict);
 
 XBT_TEST_SUITE("dict", "Dict data container");