This partial make output shows a build failure of the current trunk tarball
on FreeBSD-9/x86-64:
  CC       path.lo
/home/phargrov/OMPI/openmpi-trunk-freebsd9-amd64/openmpi-1.9a1r30146/opal/util/path.c:
In function 'opal_path_df':
/home/phargrov/OMPI/openmpi-trunk-freebsd9-amd64/openmpi-1.9a1r30146/opal/util/path.c:556:
error: 'buf' undeclared (first use in this function)
/home/phargrov/OMPI/openmpi-trunk-freebsd9-amd64/openmpi-1.9a1r30146/opal/util/path.c:556:
error: (Each undeclared identifier is reported only once
/home/phargrov/OMPI/openmpi-trunk-freebsd9-amd64/openmpi-1.9a1r30146/opal/util/path.c:556:
error: for each function it appears in.)
*** [path.lo] Error code 1

Builds of the trunk on NetBSD and OpenBSD fail in the same way.

The code in opal_path_df() seems not to define the variable "buf" unless
certain defines are present, but then tries to USE the variable
unconditionally.  That unconditional use of "buf" is the proximate cause of
the failure.

A very-likely-related observation:
The code in opal/util/path.c seems to expect __BSD to be defined under
*some* circumstance, but it is not defined by any current
{Free,Net,Open}BSD:

FreeBSD-9:
$ touch empty.c
$ gcc -dM -E empty.c | grep BSD
#define __FreeBSD_cc_version 900001
#define __VERSION__ "4.2.1 20070831 patched [FreeBSD]"
#define __FreeBSD__ 9

NetBSD-6:
-bash-4.2$ touch empty.c
-bash-4.2$ gcc -dM -E empty.c | grep BSD
#define __NetBSD__ 1

OpenBSD-5:
-bash-4.2$ touch empty.c
-bash-4.2$ gcc -dM -E empty.c | grep BSD
#define __OpenBSD__ 1

So, there are TWO issues:

1) opal_path_df() defines the variable "buf" only conditionally but then
uses it UNconditionally.

2) logic which appears to be intended for at least FreeBSD is probably not
reachable in any build.

-Paul

-- 
Paul H. Hargrove                          phhargr...@lbl.gov
Future Technologies Group
Computer and Data Sciences Department     Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900

Reply via email to