Attention is currently required from: Thomas Heijligen, Anastasia Klimchuk. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52946 )
Change subject: programmer_table: move each entry to the associated programmer source ......................................................................
Patch Set 8:
(1 comment)
File programmer.h:
https://review.coreboot.org/c/flashrom/+/52946/comment/886e5942_562e3b6b PS4, Line 402: #if CONFIG_DUMMY == 1
I thought, with the #if it would be no error: with the #if that line of code is not included and not […]
No error in this code either way. My argument is purely theoretical; trying to explain when the #if would make a difference: when the #if's and/or the selection of programmer-driver .c files are out of sync.
So, these are `extern` forward declarations. For the compiler, it's not an error to see such a declaration without the definition. Let's say we tell it to compile `programmer_table.c`. It would see the forward declarations here and would have to trust that things are defined in another compilation unit.
If we would remove the #if and then tell it to build without dummy support, we would have a forward declaration that is never referenced (the #if in `programmer_ table.c` takes care of that). That's also not an error.
But let's assume somebody would forget to place the #if in `programmer_table.c`. Then if we would have an #if here we'd get * a compiler error; it would complain about an unknown symbol, and without an #if here * (only) a linker error; the compiler would see a forward declaration and trust that the definition is in another compilation unit.
So long story short, it only makes a difference if the code is broken elsewhere. And even then a negligible difference.