]> granicus.if.org Git - esp-idf/commitdiff
Adding -fstrict-volatile-bitfields to the CFLAGS/CXXFLAGS. Without this, gcc tries...
authorJeroen Domburg <git@j0h.nl>
Sun, 18 Sep 2016 04:10:01 +0000 (12:10 +0800)
committerJeroen Domburg <git@j0h.nl>
Sun, 18 Sep 2016 04:10:01 +0000 (12:10 +0800)
grab an 8-bit field from a 32-bit). Our hardware does not like that. This flag tells gcc that if a bitfield is volatile, it should always use the type
the field is defined at (uint32_t in our case) to size its access to the field. This fixes accessing the hardware through the xxx_struct.h headers.

make/project.mk

index b86470bf62a375ae92bae95212b20af80a1b8ae4..35dccaf24833862b249814754e5c5d84d4f21eee 100644 (file)
@@ -158,13 +158,14 @@ LDFLAGS ?= -nostdlib \
 # files, set CFLAGS += in your component's Makefile.projbuild
 
 # CPPFLAGS used by an compile pass that uses the C preprocessor
-CPPFLAGS = -DESP_PLATFORM -Og -g3 -Wpointer-arith -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wall -ffunction-sections -fdata-sections -mlongcalls -nostdlib -MMD -MP
+CPPFLAGS = -DESP_PLATFORM -Og -g3 -Wpointer-arith -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable \
+               -Wno-error=unused-variable -Wall -ffunction-sections -fdata-sections -mlongcalls -nostdlib -MMD -MP
 
 # C flags use by C only
-CFLAGS = $(CPPFLAGS) -std=gnu99 -g3 -fno-inline-functions
+CFLAGS = $(CPPFLAGS) -std=gnu99 -g3 -fstrict-volatile-bitfields
 
 # CXXFLAGS uses by C++ only
-CXXFLAGS = $(CPPFLAGS) -Og -std=gnu++11 -g3 -fno-exceptions
+CXXFLAGS = $(CPPFLAGS) -Og -std=gnu++11 -g3 -fno-exceptions -fstrict-volatile-bitfields
 
 export CFLAGS CPPFLAGS CXXFLAGS