From 192e79b175582295bf3630364bbc20aca3cc2ca6 Mon Sep 17 00:00:00 2001
From: Vincent Dupont <vincent@otakeys.com>
Date: Wed, 11 Jul 2018 14:56:54 +0200
Subject: [PATCH] cpu/msp430: use gnu99 by default

---
 makefiles/arch/msp430.inc.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/makefiles/arch/msp430.inc.mk b/makefiles/arch/msp430.inc.mk
index e892289c8e..1ebe522be8 100644
--- a/makefiles/arch/msp430.inc.mk
+++ b/makefiles/arch/msp430.inc.mk
@@ -2,7 +2,11 @@
 export TARGET_ARCH ?= msp430
 
 # define build specific options
-CFLAGS_CPU   = -mmcu=$(CPU_MODEL) -std=gnu99
+CFLAGS_CPU   = -mmcu=$(CPU_MODEL)
+# default std set to gnu99 of not overwritten by user
+ifeq (, $(filter -std=%, $(CFLAGS)))
+  export CFLAGS += -std=gnu99
+endif
 CFLAGS_LINK  = -ffunction-sections -fdata-sections
 CFLAGS_DBG  ?= -gdwarf-2
 CFLAGS_OPT  ?= -Os
-- 
GitLab