Page MenuHomeFreeBSD

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

Authored by dim on Sep 13 2021, 12:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 25, 5:01 AM
Unknown Object (File)
Wed, Apr 23, 8:49 PM
Unknown Object (File)
Sat, Apr 19, 9:39 AM
Unknown Object (File)
Thu, Apr 17, 3:04 AM
Unknown Object (File)
Wed, Apr 16, 11:28 PM
Unknown Object (File)
Wed, Apr 16, 10:27 PM
Unknown Object (File)
Mar 19 2025, 4:44 AM
Unknown Object (File)
Mar 17 2025, 3:57 PM
Subscribers

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
rG FreeBSD src repository
Lint
Lint Not Applicable
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.Sep 13 2021, 2:28 PM

Also happy with dim's version...

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