Skip to content

Commit a7b8084

Browse files
authored
Merge pull request #546 from kierdavis/disable-prog-types-compat
Allow compatibility with old pgmspace API to be disabled by the user
2 parents c10eaa4 + 139b5db commit a7b8084

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Arduino.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,11 +1047,17 @@ else
10471047
endif
10481048

10491049
# Using += instead of =, so that CPPFLAGS can be set per sketch level
1050-
CPPFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERSION) $(ARDUINO_ARCH_FLAG) -D__PROG_TYPES_COMPAT__ \
1050+
CPPFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERSION) $(ARDUINO_ARCH_FLAG) \
10511051
-I$(ARDUINO_CORE_PATH) -I$(ARDUINO_VAR_PATH)/$(VARIANT) \
10521052
$(SYS_INCLUDES) $(PLATFORM_INCLUDES) $(USER_INCLUDES) -Wall -ffunction-sections \
10531053
-fdata-sections
10541054

1055+
# PROG_TYPES_COMPAT is enabled by default for compatibility with the Arduino IDE.
1056+
# By placing it before the user-provided CPPFLAGS rather than after, we allow the
1057+
# the user to disable it if they like, by adding the negation of the flag
1058+
# (-U__PROG_TYPES_COMPAT__) to the user-provided CPPFLAGS.
1059+
CPPFLAGS := -D__PROG_TYPES_COMPAT__ $(CPPFLAGS)
1060+
10551061
ifdef DEBUG
10561062
OPTIMIZATION_FLAGS= $(DEBUG_FLAGS)
10571063
else

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
1818
- New: Add generation of tags file using ctags, which automatically includes project libs and Arduino core. (https://github.com/tuna-f1sh)
1919
- New: Add template Makefile and project boilerplate initialise script, `ardmk-init`. (https://github.com/tuna-f1sh)
2020
- New: Support atmelice_isp JTAG tool as ISP programmer. (https://github.com/tuna-f1sh)
21+
- New: Compatibility with deprecated pgmspace.h API can now be disabled since it sometimes causes bogus compiler warnings (issue #546)
2122
- New: Support Arduino ARM-based (SAM/SAMD) devices. (https://github.com/tuna-f1sh)
2223

2324
### 1.6.0 (2017-07-11)

0 commit comments

Comments
 (0)