oversearch opened a new pull request #11668: URL: https://github.com/apache/pulsar/pull/11668
Master Issue: #11632 ### Motivation This change enables several key warning flags that prevent common mistakes in C++: -Wall -Wformat-security and -Wvla, as well as ensuring the code won't build if it contains warnings. This will help to keep the code base clean and stable long term. I was also planning to enable "-Wextra" as it contains several helpful warnings, but I thought the changes required to get -Wall enabled were getting a bit huge as-is, so I'm going to split that effort into two PRs. ### Modifications Most of the changes fall into four categories: * The vast majority are fixing class member initialization order warnings. These can lead to real bugs and are important to fix. * Next was unused variables or functions - these were mostly found in the tests * Functions with switches on enum values and no default/fallback case resulting in a code path with no return - just needed exception throw statements. * Finally, I also fixed several misuses of the "static" keyword: when applied to global variables or functions, this actually means that the identifier has "internal linkage", meaning it's not accessible outside the current translation unit. Putting this in a header is almost never what you want to do, but it's a common mistake since the meaning is different when applied to class members. The "inline" keyword is a better choice in these circumstances. * ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change is trivial refactoring to eliminate compiler warnings. There should be no functional change whatsoever. I did modify some of the tests to fix warnings, and added a few additional asserts. The tests are all passing. ### Documentation No doc changes are required -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
