[02/11] batctl: Fix inconsistent use of _GNU_SOURCE

Message ID 1378847522-13776-3-git-send-email-sven@narfation.org (mailing list archive)
State Accepted, archived
Headers

Commit Message

Sven Eckelmann Sept. 10, 2013, 9:11 p.m. UTC
  Either all or no source file should define _GNU_SOURCE to avoid incompatible
types or function declarations.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 Makefile    | 1 +
 bat-hosts.c | 1 -
 functions.c | 1 -
 3 files changed, 1 insertion(+), 2 deletions(-)
  

Comments

Marek Lindner Sept. 11, 2013, 10:53 a.m. UTC | #1
On Tuesday, September 10, 2013 11:11:53 PM Sven Eckelmann wrote:
> Either all or no source file should define _GNU_SOURCE to avoid incompatible
> types or function declarations.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  Makefile    | 1 +
>  bat-hosts.c | 1 -
>  functions.c | 1 -
>  3 files changed, 1 insertion(+), 2 deletions(-)

Applied in revision db34e02.

Thanks,
Marek
  

Patch

diff --git a/Makefile b/Makefile
index 1961298..7926db3 100755
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,7 @@  MANPAGE = man/batctl.8
 
 # batctl flags and options
 CFLAGS += -Wall -W -std=gnu99 -fno-strict-aliasing -MD
+CPPFLAGS += -D_GNU_SOURCE
 LDLIBS += -lm
 
 # disable verbose output
diff --git a/bat-hosts.c b/bat-hosts.c
index f0adb9c..ee862da 100644
--- a/bat-hosts.c
+++ b/bat-hosts.c
@@ -21,7 +21,6 @@ 
 
 
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdint.h>
 #include <limits.h>
diff --git a/functions.c b/functions.c
index 0359287..2a2f392 100644
--- a/functions.c
+++ b/functions.c
@@ -20,7 +20,6 @@ 
  */
 
 
-#define _GNU_SOURCE
 #include <netinet/ether.h>
 #include <arpa/inet.h>
 #include <sys/socket.h>