[libc-commits] [libc] [libc]: Add `-Wglobal-constructors` for libc tests (PR #131485)

Vinay Deshmukh via libc-commits libc-commits at lists.llvm.org
Sat Mar 22 12:58:39 PDT 2025


vinay-deshmukh wrote:

@nickdesaulniers @lntue 

With regards to: https://github.com/llvm/llvm-project/issues/119281

Do you have any suggestions on how to fix the code for  this warning?

AFAICT, by marking the test class instances as `static`, the warning goes away, but doing so prevents any tests from being run (as the PR checks are failing right now) which I'm not sure why it happens yet.

For what it's worth, the registration mechanism is identical to how Google Test does it , so one way could just be removing this warning for these warnings via pragma/NOLINTBEGIN|NOLINTEND


https://github.com/llvm/llvm-project/pull/131485


More information about the libc-commits mailing list