[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__
- #include <stdio.h> on Android clang causes an error,
Lucy Phipps <=
- Re: #include <stdio.h> on Android clang causes an error, Lucy Phipps, 2021/09/07
- Re: #include <stdio.h> on Android clang causes an error, Paul Eggert, 2021/09/08
- Re: #include <stdio.h> on Android clang causes an error, Lucy Phipps, 2021/09/08
- Re: #include <stdio.h> on Android clang causes an error, Paul Eggert, 2021/09/08
- Re: #include <stdio.h> on Android clang causes an error, Lucy Phipps, 2021/09/08
- Re: #include <stdio.h> on Android clang causes an error, Lucy Phipps, 2021/09/08
- Re: #include <stdio.h> on Android clang causes an error, Paul Eggert, 2021/09/09
- Message not available
- Fwd: #include <stdio.h> on Android clang causes an error, Lucy Phipps, 2021/09/09
- Re: #include <stdio.h> on Android clang causes an error, Jim Meyering, 2021/09/09