-
Notifications
You must be signed in to change notification settings - Fork 2.1k
make: Setting constants on compile time doesn't really set them everywhere #3256
Description
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.hin a main, for instance in thehello-worldexample (withUSEMODULE += fibof course) and calling saymake UNIVERSAL_ADDRESS_SIZE=17,
the main will use theUNIVERSAL_ADDRESS_SIZEdefault value of16, while the FIB will initialize and use it with the new value17. (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).