Browse Source

tools: iio: Define _GNU_SOURCE in Makefile

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>
Roberta Dobrescu 10 years ago
parent
commit
976d9ab112
3 changed files with 1 additions and 5 deletions
  1. 1 1
      tools/iio/Makefile
  2. 0 2
      tools/iio/generic_buffer.c
  3. 0 2
      tools/iio/iio_event_monitor.c

+ 1 - 1
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
 

+ 0 - 2
tools/iio/generic_buffer.c

@@ -18,8 +18,6 @@
  *
  */
 
-#define _GNU_SOURCE
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <dirent.h>

+ 0 - 2
tools/iio/iio_event_monitor.c

@@ -16,8 +16,6 @@
  *
  */
 
-#define _GNU_SOURCE
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdbool.h>