This is an archive of the discontinued LLVM Phabricator instance.

[libc] Fix warnings on release build.
ClosedPublic

Authored by PaulkaToast on May 5 2020, 10:25 PM.

Details

Summary

These warnings were present when building llvm-libc in release mode.

workspace/llvm-project/libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp:50:34: warning: 'None' is deprecated: Use Align() or Align(1) instead [-Wdeprecated-declarations]
  Conf.AddressAlignment = Align::None();

workspace/llvm-project/libc/utils/testutils/FDReaderUnix.cpp:19:7: warning: unused variable 'err' [-Wunused-variable]
  int err = ::pipe(pipefd);

For test-utils it seems in general we should use report_fatal_error instead of asserts as these are turned off when building in release mode.
https://llvm.org/docs/CodingStandards.html#assert-liberally

Diff Detail

Event Timeline

PaulkaToast created this revision.May 5 2020, 10:25 PM
sivachandra accepted this revision.May 5 2020, 11:05 PM

LGTM, but wait for @abrachet.

This revision is now accepted and ready to land.May 5 2020, 11:05 PM
abrachet accepted this revision.May 5 2020, 11:35 PM
abrachet added inline comments.
libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp
50–51

AddressAlignment is already defaulted in StudyConfiguration's default ctor so we don't need this line.

libc/utils/testutils/FDReaderUnix.cpp
19–20

Maybe if (::pipe(pipefd))?

PaulkaToast marked 2 inline comments as done.
This revision was automatically updated to reflect the committed changes.