Hello dostshah
Try to add this line in the Makefile under CFLAGS
CFLAGS+= -std=c99
I haven't tried it with this code before so let me know if it worked for you
Regards
This worked. Thanks a lot!
Below is a fragment of a Makefile with "CFLAGS+= -std=c99" added for an example .
#
# Application target name
TARGET = ZigbeeNodeControlBridge
###############################################################################
#User definable make parameters that may be overwritten from the command line
JENNIC_SDK ?= JN-SW-4168
ZBPRO_DEVICE_TYPE = ZCR
JENNIC_MAC ?= MiniMacShim
PDM_BUILD_TYPE ?= _NONE
BAUD ?= 1000000
DEBUG ?= NONE
VERSION ?= 0
STACK_SIZE = 6500
MINIMUM_HEAP_SIZE = 2000
# Chip variant
JENNIC_CHIP ?= JN5168
JENNIC_CHIP_FAMILY ?= JN516x
###############################################################################
# Default DK2 development kit target hardware
JENNIC_PCB ?= DEVKIT2
###############################################################################
# Select the network stack (e.g. MAC, ZBPro)
JENNIC_STACK ?= ZLLHA
###############################################################################
# commands options
# enable optional commands as required per applicaion.
#
STACK_MEASURE ?= 0
EXTENDED_DEBUG ?= 0
ZCL_ON_HOST ?= 0
DISCOVERY_ONLY_MODE ?= 0
#
###############################################################################
# Debug options - define DEBUG to enable
#DEBUG =HW
#
# Define which UART to use for HW debug
DEBUG_PORT ?= UART1
###############################################################################
CFLAGS += -DUART_BAUD_RATE=$(BAUD)
CFLAGS += -DVERSION=$(VERSION)
CFLAGS += -std=c99
ifeq ($(DEBUG_PORT), UART1)
CFLAGS += -DUART_DEBUGGING=1
CFLAGS += -DDEBUG_UART=DBG_E_UART_1
#CFLAGS += -DDEBUG_APP_OTA
CFLAGS += -DDEBUG_ZCL
CFLAGS += -DDEBUG_ZB_CONTROLBRIDGE_TASK
CFLAGS += -DTRACE_APP
endif
After this for testing added the following line to code and build the project. If the build succeeds c99 support has been enabled! (which did!)
for (int yy = 0; yy < 2; yy++) {
// initialiation of a variable inside for loop is not available before c99
}