unistd.h is not part of C - it is for Unix and Unix-like systems.  There is a test for this file in configure.ac that should be used, and the Unixism in the test should be removed or protected.  The test programs should not assume Unix/POSIX/Linux.  The other fixes look good.

Bill

William Gropp
Director, Parallel Computing Institute
Deputy Director for Research
Institute for Advanced Computing Applications and Technologies
Thomas M. Siebel Chair in Computer Science
University of Illinois Urbana-Champaign




On Feb 18, 2013, at 6:47 AM, Jeff Hammond wrote:

I'm submitting this via email because Trac is hosed right now (I
assume it will be fixed in a few hours, but I don't want to enqueue
this in my head that long).

LLVM complained about use of undeclared functions being invalid in
C99.  I fixed them in the attached patch, which is copied below.

The fix to test/mpi/rma/mutex_bench.c depends upon the patch to
test/mpi/rma/Makefile.am because otherwise the header will not be
found.

Best,

Jeff

$ cat test.patch
diff --git a/test/mpi/coll/nonblocking3.c b/test/mpi/coll/nonblocking3.c
index b1f66dd..8e896b7 100644
--- a/test/mpi/coll/nonblocking3.c
+++ b/test/mpi/coll/nonblocking3.c
@@ -16,6 +16,7 @@
#include "mpi.h"
#include <stdlib.h>
#include <stdio.h>
+#include <unistd.h>
#include <string.h>
#include <assert.h>
/* USE_STRICT_MPI may be defined in mpitestconf.h */
diff --git a/test/mpi/f90/attr/attrlangc.c b/test/mpi/f90/attr/attrlangc.c
index 6920668..2ee4ef5 100644
--- a/test/mpi/f90/attr/attrlangc.c
+++ b/test/mpi/f90/attr/attrlangc.c
@@ -124,7 +124,7 @@ void cgetsizes_( MPI_Fint *ptrSize, MPI_Fint
*intSize, MPI_Fint *aintSize )
}

/* ----------------------------------------------------------------------- */
-/* Copy and delete functions attached to keyvals
+/* Copy and delete functions attached to keyvals                           */
/* ----------------------------------------------------------------------- */
static int CMPI1_COPY_FN( MPI_Comm comm, int keyval, void *extra,
     void *inval, void *outval, int *flag )
diff --git a/test/mpi/manual/mpi_t/nem_fbox_fallback_to_queue_count.c
b/test/mpi/manual/mpi_t/nem_fbox_fallback_to_queue_count.c
index f045212..9718bbc 100644
--- a/test/mpi/manual/mpi_t/nem_fbox_fallback_to_queue_count.c
+++ b/test/mpi/manual/mpi_t/nem_fbox_fallback_to_queue_count.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
+#include <unistd.h>

#define TRY(func)                           \
    do {                                    \
diff --git a/test/mpi/rma/Makefile.am b/test/mpi/rma/Makefile.am
index 579721a..76155c5 100644
--- a/test/mpi/rma/Makefile.am
+++ b/test/mpi/rma/Makefile.am
@@ -155,5 +155,5 @@ get_accumulate_double_derived_SOURCES = get_accumulate.c
get_accumulate_int_derived_SOURCES      = get_accumulate.c

mutex_bench_SOURCES              = mutex_bench.c mcs-mutex.c mcs-mutex.h
-mutex_bench_shared_CPPFLAGS      = -DUSE_WIN_SHARED
+mutex_bench_shared_CPPFLAGS      = -DUSE_WIN_SHARED $(AM_CPPFLAGS)
mutex_bench_shared_SOURCES       = mutex_bench.c mcs-mutex.c mcs-mutex.h
diff --git a/test/mpi/rma/lockcontention3.c b/test/mpi/rma/lockcontention3.c
index 6204e94..196dfb5 100644
--- a/test/mpi/rma/lockcontention3.c
+++ b/test/mpi/rma/lockcontention3.c
@@ -8,6 +8,7 @@
#include "stdlib.h"
#include "mpitest.h"
#include <assert.h>
+#include <string.h>

#define LAST_TEST 14
#define RMA_SIZE  2048
diff --git a/test/mpi/rma/mutex_bench.c b/test/mpi/rma/mutex_bench.c
index 098382e..2db24e4 100644
--- a/test/mpi/rma/mutex_bench.c
+++ b/test/mpi/rma/mutex_bench.c
@@ -12,6 +12,7 @@
#include <assert.h>

#include <mpi.h>
+#include "mpitest.h"
#include "mcs-mutex.h"

#define NUM_ITER    1000

--
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond@alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond
<test.patch>