Skip to content

make: Setting constants on compile time doesn't really set them everywhere #3256

@Lotterleben

Description

@Lotterleben

During the work on #3022, @BytesGalore noted that adding the possibility to set constants on compile time the way we do it currently doesn't set the constant everywhere (I'll just qute him):

@Lotterleben changed to configure on compile time, but this may produce unwanted side-effects.
The defines are set right for the FIB/Universal address only (bad news).

When including the ng_fib.h in a main, for instance in the hello-world example (with USEMODULE += fib of course) and calling say make UNIVERSAL_ADDRESS_SIZE=17,
the main will use the UNIVERSAL_ADDRESS_SIZE default value of 16, while the FIB will initialize and use it with the new value 17. (same applies for all other defines)

You can reproduce it by e.g. printing the value of the defines in the FIB (e.g. in fib_init()) and in the main accordingly.
So I recommend to not provide this compile time configuration.

This is done in at least one other instance, namely the RPL Makefile (https://github.com/RIOT-OS/RIOT/blob/9ecaea4038d401659f79e6ee93b82692c90c2372/sys/net/routing/rpl/Makefile).

Metadata

Metadata

Labels

Area: build systemArea: Build systemType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions