> Removing STATIC means that (modulo LTO) the compiler will not know > whether or not the definition can be dropped. It also pollutes the > global namespace. > > IMO, lack of the use of STATIC where appropriate is a severe issue > with the EDK2 codebase. Removing STATIC to appease compiler > diagnostics is *not* the way to solve this.
Thank you for your feedback. On reflection, since gcc still _can_ distinguish between genuinely unused variables and variables who usage was optimized away like this (I think that's well known; but I just double-checked by adding a similar, but entirely unused variable to the same file - gcc then complains), and since all code in the project is going to end up being compiled under gcc as well clang, then just squelching the (slightly broken) warning under clang is not really losing useful information after all, in this case. So thank you for the ack, and agreed, now, that it is the best way to proceed. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112258): https://edk2.groups.io/g/devel/message/112258 Mute This Topic: https://groups.io/mt/103083030/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-