Skip to content

Commit

Permalink
textproc/augeas: fix build with clang 15
Browse files Browse the repository at this point in the history
During an exp-run for llvm 15 (see bug 265425), it turned out that
textproc/augeas failed to build with clang 15:

  internal.c:436:12: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'const char *' [-Wint-conversion]
      return strerror_r(errnum, buf, len);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.

This is because the GNU variant of strerror_r() is erroneously chosen.
Use the BSD variant instead.

PR:		268231
Approved by:	romain (maintainer)
MFH:		2022Q4
  • Loading branch information
DimitryAndric committed Dec 13, 2022
1 parent 2624cb3 commit 48d5133
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions textproc/augeas/files/patch-src_internal.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/internal.c.orig 2018-08-10 20:17:35 UTC
+++ src/internal.c
@@ -431,7 +431,7 @@ const char *xstrerror(int errnum, char *buf, size_t le

const char *xstrerror(int errnum, char *buf, size_t len) {
#ifdef HAVE_STRERROR_R
-# ifdef __USE_GNU
+# if defined(__USE_GNU) && defined(__GLIBC__)
/* Annoying linux specific API contract */
return strerror_r(errnum, buf, len);
# else

0 comments on commit 48d5133

Please sign in to comment.