diff options
author | Paula Toth <paulatoth@google.com> | 2020-05-07 11:55:29 -0700 |
---|---|---|
committer | Paula Toth <paulatoth@google.com> | 2020-05-07 11:56:11 -0700 |
commit | bf6f3894c4a8f7572e8c45d28d6c5c0fa6101a90 (patch) | |
tree | 7fb33a4048fd74a4fd34503464ce5fdbffb1252b /libc/utils | |
parent | e6fbce675d99982dab2e00eab390359e306d00a8 (diff) | |
download | llvm-bf6f3894c4a8f7572e8c45d28d6c5c0fa6101a90.zip llvm-bf6f3894c4a8f7572e8c45d28d6c5c0fa6101a90.tar.gz llvm-bf6f3894c4a8f7572e8c45d28d6c5c0fa6101a90.tar.bz2 |
[libc] Fix warnings on release build.
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
Reviewers: abrachet, sivachandra
Reviewed By: abrachet, sivachandra
Subscribers: tschuett, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D79469
Diffstat (limited to 'libc/utils')
-rw-r--r-- | libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp | 1 | ||||
-rw-r--r-- | libc/utils/testutils/FDReaderUnix.cpp | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp b/libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp index 2abd649..58d9bbf 100644 --- a/libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp +++ b/libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp @@ -47,7 +47,6 @@ TEST(OffsetDistribution, AlignToBegin) { TEST(OffsetDistribution, NoAlignment) { StudyConfiguration Conf; Conf.BufferSize = 8192; - Conf.AddressAlignment = Align::None(); Conf.Size.To = 1; OffsetDistribution OD(Conf); diff --git a/libc/utils/testutils/FDReaderUnix.cpp b/libc/utils/testutils/FDReaderUnix.cpp index 943d3eb..c54a1a4 100644 --- a/libc/utils/testutils/FDReaderUnix.cpp +++ b/libc/utils/testutils/FDReaderUnix.cpp @@ -16,8 +16,8 @@ namespace __llvm_libc { namespace testutils { FDReader::FDReader() { - int err = ::pipe(pipefd); - assert(!err && "pipe(2) failed"); + if (::pipe(pipefd)) + llvm::report_fatal_error("pipe(2) failed"); } FDReader::~FDReader() { |