Skip to contentSkip to conversation

alfred: Enable _GNU_SOURCE by default

PATCH Applied Sven Eckelmann 2 participants 2 messages Sep 23, 2016 – Oct 14, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alfred: Enable _GNU_SOURCE by default

alfred uses any netlink library which is (more or less) compatible with libnl-3. This is for example libnl-tiny on OpenWrt.

Programs and libraries which are build against libnl-tiny must be build with _GNU_SOURCE enabled to have some types in its headers defined. Thus _GNU_SOURCE is enabled in the OpenWrt alfred package since 2016.3. But sometimes using _GNU_SOURCE and sometimes not using it can have severe side effects which are non-trivial to debug when the developer is not also using the same _GNU_SOURCE preprocessor define. Thus enable _GNU_SOURCE by default to have similar behavior (defines, type definitions, structure members, ...) from headers like on OpenWrt.

---
 Makefile      | 1 +
 gpsd/Makefile | 1 +
 vis/Makefile  | 1 +
 3 files changed, 3 insertions(+)
Makefile +1 -0
index 6daa904..552e690 100755
@@ -36,6 +36,7 @@ MANPAGE = man/alfred.8
 
 # alfred flags and options
 CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP
+CPPFLAGS += -D_GNU_SOURCE
 LDLIBS += -lrt
 
 # Turn on alfred capability dropping by default - set this to n if you don't want/need it
gpsd/Makefile +1 -0
index bae5660..b6172d9 100755
@@ -25,6 +25,7 @@ MANPAGE = man/alfred-gpsd.8
 
 # alfred flags and options
 CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP
+CPPFLAGS += -D_GNU_SOURCE
 
 # disable verbose output
 ifneq ($(findstring $(MAKEFLAGS),s),s)
vis/Makefile +1 -0
index fd99f49..22483a5 100755
@@ -27,6 +27,7 @@ MANPAGE = man/batadv-vis.8
 
 # batadv-vis flags and options
 CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP
+CPPFLAGS += -D_GNU_SOURCE
 LDLIBS += -lrt
 
 # disable verbose output
Signature · 1 line
2.9.3
#1 lore raw
Quoted 12 lines · CEST Sven Eckelmann

alfred uses any netlink library which is (more or less) compatible with libnl-3. This is for example libnl-tiny on OpenWrt.

Programs and libraries which are build against libnl-tiny must be build with _GNU_SOURCE enabled to have some types in its headers defined. Thus _GNU_SOURCE is enabled in the OpenWrt alfred package since 2016.3. But sometimes using _GNU_SOURCE and sometimes not using it can have severe side effects which are non-trivial to debug when the developer is not also using the same _GNU_SOURCE preprocessor define. Thus enable _GNU_SOURCE by default to have similar behavior (defines, type definitions, structure members, ...) from headers like on OpenWrt.

Quoted 1 line

Applied in revision 415ebc7

Thanks!
Simon