[riot-notifications] [RIOT-OS/RIOT] riotboot.mk: get variable as hex rather than dec (#11201)

Juan I Carrano notifications at github.com
Tue Mar 19 11:30:36 CET 2019


> Suggest making the same change in other locations where shell echo is used to sum hex variables?

Yes. If we precede all hex values by "0x" we ensure that no command can interpret that as decimal. Also, it makes 100% sense that summing hex gives back hex.

Running `git grep '$((.*+.*))'` gives:

```
boards/esp32-olimex-evb/Makefile.include:        $(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
cpu/esp32/Makefile.dep:    $(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
cpu/esp32/Makefile.dep:    $(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
cpu/esp8266/Makefile.include:    $(eval GNRC_NETIF_NUMOF=$(shell echo $$(($(GNRC_NETIF_NUMOF)+1))))
dist/tools/openocd/openocd.sh:        IMAGE_OFFSET=$(printf "0x%08x\n" "$((${IMAGE_OFFSET} + ${FLASH_ADDR}))")
makefiles/boot/riotboot.mk:export SLOT1_OFFSET ?= $(shell echo $$(($(SLOT0_OFFSET) + $(SLOT0_LEN))))
makefiles/boot/riotboot.mk:SLOT0_IMAGE_OFFSET := $$(($(SLOT0_OFFSET) + $(RIOTBOOT_HDR_LEN)))
makefiles/boot/riotboot.mk:SLOT1_IMAGE_OFFSET := $$(($(SLOT1_OFFSET) + $(RIOTBOOT_HDR_LEN)))
makefiles/boot/riotboot.mk:     $(Q)$(HEADER_TOOL) generate $< $(APP_VER) $$(($(ROM_START_ADDR)+$(OFFSET))) $(RIOTBOOT_HDR_LEN) - $
makefiles/boot/riotboot.mk:     $(Q)truncate -s $$(($(SLOT0_OFFSET) + $(SLOT0_LEN) + $(RIOTBOOT_HDR_LEN))) $@.tmp
makefiles/info-nproc.inc.mk:    NPROC := $(shell echo $$(($(NPROC) + 1)))
makefiles/mcuboot.mk:   $(Q)$(_LINK) $(LINKFLAGPREFIX)--defsym=offset="$$(($(MCUBOOT_SLOT0_SIZE) + $(IMAGE_HDR_SIZE)))" \
tests/cortexm_common_ldscript/Makefile: EXPECT_START_ADDR=$$(printf "0x%08x" $$(( $(ROM_START_ADDR) + $* ))); \
tests/cortexm_common_ldscript/Makefile:test-assert_overflow_too_big_for_rom: FW_ROM_LEN=$$(($(ROM_LEN_BYTES) + 1))
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11201#issuecomment-474293854
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190319/3bf49817/attachment.html>


More information about the notifications mailing list