build: add --enable-optimization-warnings
Start off by adding -Wpadded and -Wno-error=padded . This is useful when investigating holes in the struct layout. Alternatively, the pahole utility can be used for this.
Dridi suggested that I add this to a new class of warnings.
I am not entirely on board with this, because there are valid reasons not want structs tightly packed, for instance cacheline considerations.
It also bothers me that the patch calls them "OPTIMIZATION_FLAGS", they're not. At best they're "DEVELOPER_INFORMATION_FLAGS" or something of that sort.
I am not entirely on board with this, because there are valid reasons not want structs tightly packed, for instance cacheline considerations.
Yes, we can always ignore false-positives. The intend was not to enable this by default. We could also place a reserved variable there to fill the hole and make it more explicit. Then, in the future, we can use this space for something else rather than expanding the struct size.
It also bothers me that the patch calls them "OPTIMIZATION_FLAGS", they're not. At best they're "DEVELOPER_INFORMATION_FLAGS" or something of that sort.
Sure, we can rename it.
I do not think it make sense to enable this through the default ./autogen.des invocation, at least not before we have reviewed what we got first.
would @asadsa92's proposed changes help it past the finish line?