bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

#include <stdio.h> on Android clang causes an error


From: Lucy Phipps
Subject: #include <stdio.h> on Android clang causes an error
Date: Tue, 7 Sep 2021 14:11:50 +0100

For example, building gzip 1.11 from the tar.xz source:
In file included from /home/builder/.termux-build/gzip/src/lib/freading.c:20:
In file included from /home/builder/.termux-build/gzip/src/lib/freading.h:18:
In file included from ./stdio.h:43:
In file included from
/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/include/stdio.h:47:
In file included from ./string.h:52:
In file included from ./stdlib.h:36:
In file included from
/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/include/stdlib.h:34:
/home/builder/.termux-build/_cache/android-r21d-api-24-v5/bin/../sysroot/usr/include/malloc.h:168:37:
error: unknown type name 'FILE'
int malloc_info(int __must_be_zero, FILE* __fp) __INTRODUCED_IN(23);

The problem is
The patch I ended up using on Termux is very simple, but assumes
gnulib didn't replace free()
diff --git a/lib/string.in.h b/lib/string.in.h
index fa2e40c..46b7a14 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -48,7 +48,7 @@
 #include <stddef.h>

 /* Get free().  */
-#include <stdlib.h>
+void free(void *);

 /* MirBSD defines mbslen as a macro.  */
 #if @GNULIB_MBSLEN@ && defined __MirBSD__



reply via email to

[Prev in Thread] Current Thread [Next in Thread]