Page MenuHomeFreeBSD

Add -Wno-error=unused-but-set-variable when building with Clang 13+
ClosedPublic

Authored by dim on Mon, Sep 13, 12:29 PM.

Details

Summary

This warning triggers many times while building world. Downgrade it to
a warning until all occurrences have been fixed. Once the Clang warnings
have been fixed we should be able to turn it on for GCC as well.
See also f4fed768bba45a406f73ed1491d7e52fd1a8711d which did the same for
the kernel builds.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

This change was sufficient to build and test amd64 with LLVM HEAD as of today.

I did this slightly differently in https://github.com/DimitryAndric/freebsd-src/commit/73a8f96dc7c12ebf76f5a40a7f1208c11f75741f, and I put it in another if block. It would be nice to choose either my version or yours, and integrate it right away, so I don't get needless merge conflicts the next time I sync up the llvm-13-update branch with main.

In D31927#720365, @dim wrote:

I did this slightly differently in https://github.com/DimitryAndric/freebsd-src/commit/73a8f96dc7c12ebf76f5a40a7f1208c11f75741f, and I put it in another if block. It would be nice to choose either my version or yours, and integrate it right away, so I don't get needless merge conflicts the next time I sync up the llvm-13-update branch with main.

Making it an error for WARNS=6 seems reasonable. Happy to just use you version instead.

Either one is fine with me, and agree we should get it in HEAD immediately, independent of the merge of Clang 13.

This revision is now accepted and ready to land.Mon, Sep 13, 2:28 PM

Also happy with dim's version...

dim edited reviewers, added: arichardson; removed: dim.