[PATCH 4/5] tools: iio: Define _GNU_SOURCE in Makefile

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

 



Definition of _GNU_SOURCE is needed to get rid of some warnings, such
as:
warning: implicit declaration of function `asprintf'.

generic_buffer.c and iio_event_monitor.c define _GNU_SOURCE,
but it is also needed in lsiio.c and iio_utils.c. For this reason,
this patch adds the definition in Makefile and removes it from where
it already exists.

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@xxxxxxxxx>
---
 tools/iio/Makefile            | 2 +-
 tools/iio/generic_buffer.c    | 2 --
 tools/iio/iio_event_monitor.c | 2 --
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/iio/Makefile b/tools/iio/Makefile
index 83813ad..bf7ae6d 100644
--- a/tools/iio/Makefile
+++ b/tools/iio/Makefile
@@ -1,5 +1,5 @@
 CC = gcc
-CFLAGS = -Wall -g
+CFLAGS = -Wall -g -D_GNU_SOURCE
 
 all: iio_event_monitor lsiio generic_buffer
 
diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
index 01266c2..8f8f058 100644
--- a/tools/iio/generic_buffer.c
+++ b/tools/iio/generic_buffer.c
@@ -18,8 +18,6 @@
  *
  */
 
-#define _GNU_SOURCE
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <dirent.h>
diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
index f19cff1..427c271 100644
--- a/tools/iio/iio_event_monitor.c
+++ b/tools/iio/iio_event_monitor.c
@@ -16,8 +16,6 @@
  *
  */
 
-#define _GNU_SOURCE
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdbool.h>
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux