From 19a0db26f3ca35322c27d7b5084d2899da07bf9f Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Fri, 21 Aug 2020 05:45:33 +0200 Subject: Add missing stdio.h include for asprintf Without that fix we have the following with clang and -Wimplicit-function-declaration when building with Guix: network.c:219:2: warning: implicit declaration of function 'asprintf' is invalid in C99 [-Wimplicit-function-declaration] asprintf(®istration[0], "%d", status); ^ The definition of _GNU_SOURCE is required to remove the warning, and it is also mentioned in the asprintf man in the SYNOPSIS: SYNOPSIS #define _GNU_SOURCE /* See feature_test_macros(7) */ #include int asprintf(char **strp, const char *fmt, ...); [...] With that fix, libsamsung-ril still compiles fine without any warnings under Replicant 6.0. Signed-off-by: Denis 'GNUtoo' Carikli --- data.c | 2 ++ misc.c | 2 ++ network.c | 2 ++ ss.c | 3 +++ 4 files changed, 9 insertions(+) diff --git a/data.c b/data.c index dd39926..247b00d 100644 --- a/data.c +++ b/data.c @@ -18,6 +18,8 @@ * along with Samsung-RIL. If not, see . */ +#define _GNU_SOURCE +#include #include #include diff --git a/misc.c b/misc.c index e9ec767..bece1c1 100644 --- a/misc.c +++ b/misc.c @@ -18,6 +18,8 @@ * along with Samsung-RIL. If not, see . */ +#define _GNU_SOURCE +#include #include #define LOG_TAG "RIL" diff --git a/network.c b/network.c index 1ce903e..e24be5e 100644 --- a/network.c +++ b/network.c @@ -21,6 +21,8 @@ * along with Samsung-RIL. If not, see . */ +#define _GNU_SOURCE +#include #include #include diff --git a/ss.c b/ss.c index 51aa46d..15d2b55 100644 --- a/ss.c +++ b/ss.c @@ -18,6 +18,9 @@ * along with Samsung-RIL. If not, see . */ +#define _GNU_SOURCE +#include + #define LOG_TAG "RIL-SS" #include -- cgit v1.2.3