diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-08-21 05:45:33 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-08-27 18:12:58 +0200 |
commit | 19a0db26f3ca35322c27d7b5084d2899da07bf9f (patch) | |
tree | 274e555ed67ac0cf81ff319ed21c4d71e61f6e43 | |
parent | 6fa18cecc268583cbd727f7a34da4a1f1e85d218 (diff) | |
download | hardware_replicant_libsamsung-ril-19a0db26f3ca35322c27d7b5084d2899da07bf9f.tar.gz hardware_replicant_libsamsung-ril-19a0db26f3ca35322c27d7b5084d2899da07bf9f.tar.bz2 hardware_replicant_libsamsung-ril-19a0db26f3ca35322c27d7b5084d2899da07bf9f.zip |
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 <stdio.h>
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 <GNUtoo@cyberdimension.org>
-rw-r--r-- | data.c | 2 | ||||
-rw-r--r-- | misc.c | 2 | ||||
-rw-r--r-- | network.c | 2 | ||||
-rw-r--r-- | ss.c | 3 |
4 files changed, 9 insertions, 0 deletions
@@ -18,6 +18,8 @@ * along with Samsung-RIL. If not, see <http://www.gnu.org/licenses/>. */ +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> #include <arpa/inet.h> @@ -18,6 +18,8 @@ * along with Samsung-RIL. If not, see <http://www.gnu.org/licenses/>. */ +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> #define LOG_TAG "RIL" @@ -21,6 +21,8 @@ * along with Samsung-RIL. If not, see <http://www.gnu.org/licenses/>. */ +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -18,6 +18,9 @@ * along with Samsung-RIL. If not, see <http://www.gnu.org/licenses/>. */ +#define _GNU_SOURCE +#include <stdio.h> + #define LOG_TAG "RIL-SS" #include <utils/Log.h> |