[mpich] MPICH primary repository branch, master, updated. v3.0.3-37-gfec2569
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via fec2569df449da7e1266e83be8900ef17f18456d (commit) via 9873c9a2afa1a49eb3004d26a8641f49426be491 (commit) via 86e9688fa2d942bd54b0ff11009c74582d5279c8 (commit) via ce7fa89bc640a4aba39f3398c4215e1f0f6d6f1f (commit) from 934bd27d4948d9e5ef430267981045bf9a7d2fa4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/fec2569df449da7e1266e83be8900ef17f... commit fec2569df449da7e1266e83be8900ef17f18456d Author: Dave Goodell <[email protected]> Date: Fri Mar 22 18:07:33 2013 -0500 fix uninitialized variable warnings These were not spotted earlier because our `--enable-strict` functionality was broken, especially under clang. Reviewed-by: balaji diff --git a/src/mpi/coll/helper_fns.c b/src/mpi/coll/helper_fns.c index 60741a0..677b0b7 100644 --- a/src/mpi/coll/helper_fns.c +++ b/src/mpi/coll/helper_fns.c @@ -47,7 +47,8 @@ int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status) int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { - int mpi_errno, context_id; + int mpi_errno = MPI_SUCCESS; + int context_id; MPID_Request *request_ptr=NULL; MPID_Comm *comm_ptr=NULL; MPIDI_STATE_DECL(MPID_STATE_MPIC_SEND); @@ -88,7 +89,8 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status) { - int mpi_errno, context_id; + int mpi_errno = MPI_SUCCESS; + int context_id; MPID_Request *request_ptr=NULL; MPID_Comm *comm_ptr = NULL; MPIDI_STATE_DECL(MPID_STATE_MPIC_RECV); @@ -136,7 +138,8 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { - int mpi_errno, context_id; + int mpi_errno = MPI_SUCCESS; + int context_id; MPID_Request *request_ptr=NULL; MPID_Comm *comm_ptr=NULL; MPIDI_STATE_DECL(MPID_STATE_MPIC_SSEND); @@ -180,7 +183,8 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, MPI_Comm comm, MPI_Status *status) { MPID_Request *recv_req_ptr=NULL, *send_req_ptr=NULL; - int mpi_errno, context_id; + int mpi_errno = MPI_SUCCESS; + int context_id; MPID_Comm *comm_ptr = NULL; MPIDI_STATE_DECL(MPID_STATE_MPIC_SENDRECV); @@ -476,7 +480,8 @@ int MPIR_Localcopy(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request) { - int mpi_errno, context_id; + int mpi_errno = MPI_SUCCESS; + int context_id; MPID_Request *request_ptr=NULL; MPID_Comm *comm_ptr=NULL; MPIDI_STATE_DECL(MPID_STATE_MPIC_ISEND); @@ -511,7 +516,8 @@ int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Request *request) { - int mpi_errno, context_id; + int mpi_errno = MPI_SUCCESS; + int context_id; MPID_Request *request_ptr=NULL; MPID_Comm *comm_ptr = NULL; MPIDI_STATE_DECL(MPID_STATE_MPIC_IRECV); http://git.mpich.org/mpich.git/commitdiff/9873c9a2afa1a49eb3004d26a8641f4942... commit 9873c9a2afa1a49eb3004d26a8641f49426be491 Author: Dave Goodell <[email protected]> Date: Fri Mar 22 16:38:04 2013 -0500 use C99-standard `__VA_ARGS__` Use C99-standard `__VA_ARGS__` instead of a non-standard GCC extension that does the same thing. This version based on code review feedback from Pavan. No reviewer. diff --git a/src/mpid/ch3/include/mpidimpl.h b/src/mpid/ch3/include/mpidimpl.h index a33c8c8..1350e64 100644 --- a/src/mpid/ch3/include/mpidimpl.h +++ b/src/mpid/ch3/include/mpidimpl.h @@ -1018,15 +1018,15 @@ extern char *MPIDI_DBG_parent_str; #define MPIDI_ERR_PRINTF(e) MPIDI_err_printf e -#if defined(HAVE_CPP_VARARGS) -# define MPIDI_dbg_printf(level, func, fmt, args...) \ +#if defined(HAVE_MACRO_VA_ARGS) +# define MPIDI_dbg_printf(level, func, fmt, ...) \ { \ - MPIU_dbglog_printf("[%d] %s(): " fmt "\n", MPIR_Process.comm_world->rank, func, ## args); \ + MPIU_dbglog_printf("[%d] %s(): " fmt "\n", MPIR_Process.comm_world->rank, func, __VA_ARGS__); \ } -# define MPIDI_err_printf(func, fmt, args...) \ +# define MPIDI_err_printf(func, fmt, ...) \ { \ - MPIU_Error_printf("[%d] ERROR - %s(): " fmt "\n", MPIR_Process.comm_world->rank, func, ## args); \ - fflush(stdout); \ + MPIU_Error_printf("[%d] ERROR - %s(): " fmt "\n", MPIR_Process.comm_world->rank, func, __VA_ARGS__); \ + fflush(stdout); \ } #endif diff --git a/src/mpid/ch3/subconfigure.m4 b/src/mpid/ch3/subconfigure.m4 index efe1acc..f90cc94 100644 --- a/src/mpid/ch3/subconfigure.m4 +++ b/src/mpid/ch3/subconfigure.m4 @@ -197,20 +197,6 @@ The ch3 devies was selected yet a set of working OpenPA headers were not found. Please check the OpenPA configure step for errors.]) fi -AC_CACHE_CHECK([whether CPP accepts variable length argument lists], -pac_cv_have_cpp_varargs,[ -AC_TRY_COMPILE([ -#include <stdio.h> -#define MY_PRINTF(rank, fmt, args...) printf("%d: " fmt, rank, ## args) -],[ -MY_PRINTF(0, "hello"); -MY_PRINTF(1, "world %d", 3); -], pac_cv_have_cpp_varargs=yes, pac_cv_have_cpp_varargs=no) -]) -if test $pac_cv_have_cpp_varargs = "yes" ; then - AC_DEFINE(HAVE_CPP_VARARGS,,[Define if CPP supports macros with a variable number arguments]) -fi - AC_C_BIGENDIAN ])dnl end AM_COND_IF(BUILD_CH3,...) diff --git a/src/mpid/ch3/util/sock/subconfigure.m4 b/src/mpid/ch3/util/sock/subconfigure.m4 index 9db116d..994bf6a 100644 --- a/src/mpid/ch3/util/sock/subconfigure.m4 +++ b/src/mpid/ch3/util/sock/subconfigure.m4 @@ -28,21 +28,6 @@ AC_DEFUN([PAC_SUBCFG_BODY_]PAC_SUBCFG_AUTO_SUFFIX,[ dnl AC_CHECK_FUNCS(CFUUIDCreate uuid_generate time) dnl AC_SEARCH_LIBS(uuid_generate, uuid) - dnl FIXME this should be a common test, already performed at a higher level - AC_CACHE_CHECK([whether CPP accepts variable length argument lists], - pac_cv_have_cpp_varargs,[ -AC_TRY_COMPILE([ -#include <stdio.h> -#define MY_PRINTF(rank, fmt, args...) printf("%d: " fmt, rank, ## args) -],[ -MY_PRINTF(0, "hello"); -MY_PRINTF(1, "world %d", 3); -], pac_cv_have_cpp_varargs=yes, pac_cv_have_cpp_varargs=no) - ]) - if test $pac_cv_have_cpp_varargs = "yes" ; then - AC_DEFINE(HAVE_CPP_VARARGS,,[Define if CPP supports macros with a variable number arguments]) - fi - # If we need the socket code, see if we can use struct ifconf # sys/socket.h is needed on Solaris AC_CACHE_CHECK([whether we can use struct ifconf], http://git.mpich.org/mpich.git/commitdiff/86e9688fa2d942bd54b0ff11009c74582d... commit 86e9688fa2d942bd54b0ff11009c74582d5279c8 Author: Dave Goodell <[email protected]> Date: Fri Mar 22 15:46:52 2013 -0500 strict: add `-Werror-implicit-function-declaration` We want to fail-fast when these obvious bugs are spotted by the compiler, rather than much later when we attempt to link `examples/cpi`. The biggest risk to this sort of change is that it _might_ break some subsequent autoconf-layer tests which use implicit functions. Reviewed-by: balaji diff --git a/confdb/aclocal_cc.m4 b/confdb/aclocal_cc.m4 index 1492da4..237c435 100644 --- a/confdb/aclocal_cc.m4 +++ b/confdb/aclocal_cc.m4 @@ -481,6 +481,10 @@ if test "$enable_strict_done" != "yes" ; then # compare it to 0 later to see if it was updated. Also when using strtod() # one needs to compare the return value with 0 to see whether a conversion # was performed. + # -Werror-implicit-function-declaration -- implicit function declarations + # should never be tolerated. This also ensures that we get quick + # compilation failures rather than later link failures that usually + # come from a function name typo. # the embedded newlines in this string are safe because we evaluate each # argument in the for-loop below and append them to the CFLAGS with a space # as the separator instead @@ -514,6 +518,7 @@ if test "$enable_strict_done" != "yes" ; then -Wvariadic-macros -Wno-format-zero-length -Wno-type-limits + -Werror-implicit-function-declaration " enable_c89=yes http://git.mpich.org/mpich.git/commitdiff/ce7fa89bc640a4aba39f3398c4215e1f0f... commit ce7fa89bc640a4aba39f3398c4215e1f0f6d6f1f Author: Dave Goodell <[email protected]> Date: Fri Mar 22 15:39:09 2013 -0500 un-break `--enable-strict` when using clang It turns out that `--enable-strict` stopped working at some point when building with clang. It would treat the conftest program which was intended to elicit a warning as being completely erroneous. My fix is to instead emit a program with more modest intentional bugs so that we will get simple warnings which most compilers will detect. Reviewed-by: balaji diff --git a/confdb/aclocal_cc.m4 b/confdb/aclocal_cc.m4 index 2e1afcc..1492da4 100644 --- a/confdb/aclocal_cc.m4 +++ b/confdb/aclocal_cc.m4 @@ -71,7 +71,18 @@ if test "$pac_result" = "yes" \ -a "$pac_c_check_compiler_option_prototest" != "no" ; then AC_MSG_CHECKING([whether C compiler option $1 works with an invalid prototype program]) AC_LINK_IFELSE([ - AC_LANG_SOURCE([void main(){ return 0; }]) + dnl We want a warning, but we don't want to inadvertently disable + dnl special warnings like -Werror-implicit-function-declaration (e.g., + dnl in PAC_CC_STRICT) by compiling something that might actually be + dnl treated as an error by the compiler. So we try to elicit an + dnl "unused variable" warning and/or an "uninitialized" warning with the + dnl test program below. + dnl + dnl The old sanity program was: + dnl void main() {return 0;} + dnl which clang (but not GCC) would treat as an *error*, invalidating + dnl the test for any given parameter. + AC_LANG_SOURCE([int main(int argc, char **argv){ int foo, bar = 0; foo += 1; return foo; }]) ],[pac_result=yes],[pac_result=no]) AC_MSG_RESULT([$pac_result]) fi ----------------------------------------------------------------------- Summary of changes: confdb/aclocal_cc.m4 | 18 +++++++++++++++++- src/mpi/coll/helper_fns.c | 18 ++++++++++++------ src/mpid/ch3/include/mpidimpl.h | 12 ++++++------ src/mpid/ch3/subconfigure.m4 | 14 -------------- src/mpid/ch3/util/sock/subconfigure.m4 | 15 --------------- 5 files changed, 35 insertions(+), 42 deletions(-) hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org