From: Gabriel Corona Date: Mon, 15 Jun 2015 23:08:27 +0000 (+0200) Subject: Remove PRINTF_STR X-Git-Tag: v3_12~599 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8267acf4041aed91587c80b977eec7a8a154f21c Remove PRINTF_STR It was only used in tests. --- diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index ba8db2baf1..9ceb7ef974 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -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))" diff --git a/buildtools/Cmake/PrintArgs.cmake b/buildtools/Cmake/PrintArgs.cmake index e4ed2e81b3..a3c0603125 100644 --- a/buildtools/Cmake/PrintArgs.cmake +++ b/buildtools/Cmake/PrintArgs.cmake @@ -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})") diff --git a/buildtools/Cmake/src/internal_config.h.in b/buildtools/Cmake/src/internal_config.h.in index 36125383ae..edfd175a6c 100644 --- a/buildtools/Cmake/src/internal_config.h.in +++ b/buildtools/Cmake/src/internal_config.h.in @@ -285,9 +285,6 @@ /* "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@ diff --git a/src/portable.h b/src/portable.h index c4caaf9a7c..6e8f6b7004 100644 --- a/src/portable.h +++ b/src/portable.h @@ -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 */ diff --git a/src/xbt/dict.c b/src/xbt/dict.c index d59086b851..f43c987cd3 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -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");