Hi Bruno, Bruno Haible <br...@clisp.org> writes:
> It was never resolved, correct. Alexandre's mail from 2021 is still unresolved > on my side. But when I try the testdir4 recipe from that thread today, > with all versions from clang 18 down to clang 11, it all compiles fine. > I therefore believe that Alexandre's problem was fixed through > https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=0b3f5d1b4c0b13bb51b4b6aa63392aa5231da3fc > > But it was a different situation, without <sys/un.h>. Right, that patch looks like it would have fixed that case. > The patch does not look right, no. AFAIU, __CORRECT_ISO_CPP_STRING_H_PROTO > is defined for all modern versions of clang, and what your patch does > is to disable the _GL_CXXALIASWARN / _GL_CXXALIASWARN1 code in this > situation. > > What I see is that if I move the '#include <string.h>' from inside to > outside the __BEGIN_DECLS / __END_DECLS block in <sys/un.h>, the errors > go away. This suggests that the fix is to make sure <string.h> is > included first, outside an 'extern "C++" { ... }' block. Yes, my patch was less than ideal but it worked for the time being. Your fix works better, thanks for that and the bug report. Hopefully my experiments helped you a bit at least. Collin