tools: iio: Define _GNU_SOURCE in Makefile
authorRoberta Dobrescu <roberta.dobrescu@gmail.com>
Thu, 26 Feb 2015 08:49:26 +0000 (10:49 +0200)
committerJonathan Cameron <jic23@kernel.org>
Mon, 9 Mar 2015 17:17:26 +0000 (17:17 +0000)
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@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
tools/iio/Makefile
tools/iio/generic_buffer.c
tools/iio/iio_event_monitor.c

index 83813ad..bf7ae6d 100644 (file)
@@ -1,5 +1,5 @@
 CC = gcc
-CFLAGS = -Wall -g
+CFLAGS = -Wall -g -D_GNU_SOURCE
 
 all: iio_event_monitor lsiio generic_buffer
 
index 01266c2..8f8f058 100644 (file)
@@ -18,8 +18,6 @@
  *
  */
 
-#define _GNU_SOURCE
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <dirent.h>
index f19cff1..427c271 100644 (file)
@@ -16,8 +16,6 @@
  *
  */
 
-#define _GNU_SOURCE
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdbool.h>