Just to expand on this issue a bit: the bug is netcdf's fault, not clang's.
In contrib/netcdf/4.3.0/ncgen3/genlib.h, they have the following:
#ifndef HAVE_STRLCAT
extern size_t strlcat(char *dst, const char *src, size_t siz);
#endif
which my compiler somehow reaches even though my system _does_ have
strlcat. The problem is that they don't actually include their own
config.h in genlib.h, so this #ifndef is _always_ true.
I also confirmed that with the test code below, which compiles just fine
when the offending extern declaration is commented out, but errors
otherwise.
So I've now patched our copy of genlib.h to #include "config.h", and things
seem to be happy as far as compiling libmesh with clang on Mavericks is
concerned.
Anyone ever successfully submit patches to netcdf upstream before?
--
John
#include <stdio.h>
#include <string.h>
/* extern size_t strlcat(char *dst, const char *src, size_t siz); */
int main()
{
const char somestring[] = "bar";
char buf[5] = "foo";
if (strlcat(buf, somestring, sizeof(buf)) >= sizeof(buf))
printf("somestring was truncated when concatenating to buf.\n");
return 0;
}
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel