From 88f02bc5dabbd5638e112f8411f44254178917f3 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Fri, 5 Jun 2020 16:37:20 -0700 Subject: [PATCH] Add _GNU_SOURCE to all files If configured with CFLAGS=-std=c99, then quite a few warnings are raised, as well as a couple of errors. By forcing the system to use _GNU_SOURCE, we can allow the compilation to succeed even if using a user defined C standard. --- lib/libx52/x52_date_time.c | 1 + utils/cli/x52_cli.c | 1 + utils/test/x52_test.c | 2 ++ utils/test/x52_test_clock.c | 1 + utils/test/x52_test_led.c | 1 + utils/test/x52_test_mfd.c | 1 + 6 files changed, 7 insertions(+) diff --git a/lib/libx52/x52_date_time.c b/lib/libx52/x52_date_time.c index 28110b0..bd8ad41 100644 --- a/lib/libx52/x52_date_time.c +++ b/lib/libx52/x52_date_time.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ +#define _GNU_SOURCE #include "config.h" #include #include diff --git a/utils/cli/x52_cli.c b/utils/cli/x52_cli.c index b403697..e75cd4d 100644 --- a/utils/cli/x52_cli.c +++ b/utils/cli/x52_cli.c @@ -143,6 +143,7 @@ possibly through \b sudo(8) */ +#define _GNU_SOURCE #include "config.h" #include #include diff --git a/utils/test/x52_test.c b/utils/test/x52_test.c index 81f4640..9207bd9 100644 --- a/utils/test/x52_test.c +++ b/utils/test/x52_test.c @@ -6,11 +6,13 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ +#define _GNU_SOURCE #include "config.h" #include #include #include #include +#include #include #include "libx52.h" diff --git a/utils/test/x52_test_clock.c b/utils/test/x52_test_clock.c index e084e1e..c0371e7 100644 --- a/utils/test/x52_test_clock.c +++ b/utils/test/x52_test_clock.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ +#define _GNU_SOURCE #include "config.h" #include #include diff --git a/utils/test/x52_test_led.c b/utils/test/x52_test_led.c index 002171d..ed197f7 100644 --- a/utils/test/x52_test_led.c +++ b/utils/test/x52_test_led.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ +#define _GNU_SOURCE #include "config.h" #include #include diff --git a/utils/test/x52_test_mfd.c b/utils/test/x52_test_mfd.c index 11d9307..dc68736 100644 --- a/utils/test/x52_test_mfd.c +++ b/utils/test/x52_test_mfd.c @@ -6,6 +6,7 @@ * SPDX-License-Identifier: GPL-2.0-only WITH Classpath-exception-2.0 */ +#define _GNU_SOURCE #include "config.h" #include #include