[libc-commits] [libc] e973ab1 - [libc][NFC] Fix few warnings in tests. (#81262)

via libc-commits libc-commits at lists.llvm.org
Fri Feb 9 08:23:43 PST 2024


Author: lntue
Date: 2024-02-09T11:23:39-05:00
New Revision: e973ab150a802a9503ca34753589d29863df30cc

URL: https://github.com/llvm/llvm-project/commit/e973ab150a802a9503ca34753589d29863df30cc
DIFF: https://github.com/llvm/llvm-project/commit/e973ab150a802a9503ca34753589d29863df30cc.diff

LOG: [libc][NFC] Fix few warnings in tests. (#81262)

```
/usr/local/google/home/lntue/experiment/llvm/llvm-project/libc/test/src/__support/FPUtil/fpbits_test.cpp:268:2: warning: extra ';' outside of a function is incompatible with C++98 [-Wc++98-compat-extra-semi]
};
 ^
1 warning generated.
```

```
In file included from /usr/local/google/home/lntue/experiment/llvm/llvm-project/libc/test/src/sys/socket/linux/bind_test.cpp:17:
/usr/local/google/home/lntue/experiment/llvm/llvm-project/libc/test/UnitTest/Test.h:17:9: warning: 'libc_make_test_file_path' macro redefined [-Wmacro-redefined]
#define libc_make_test_file_path(file_name) (file_name)
        ^
/usr/local/google/home/lntue/experiment/llvm/llvm-project/libc/test/UnitTest/LibcTest.h:20:9: note: previous definition is here
#define libc_make_test_file_path(file_name)                                    \
        ^
1 warning generated.
```

Added: 
    

Modified: 
    libc/test/src/__support/FPUtil/fpbits_test.cpp
    libc/test/src/sys/socket/linux/bind_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/test/src/__support/FPUtil/fpbits_test.cpp b/libc/test/src/__support/FPUtil/fpbits_test.cpp
index 4504a4f0cfcc7d..b1c4b6691b6eec 100644
--- a/libc/test/src/__support/FPUtil/fpbits_test.cpp
+++ b/libc/test/src/__support/FPUtil/fpbits_test.cpp
@@ -265,7 +265,7 @@ template <typename T> constexpr auto make(Sign sign, FP fp) {
   case FP::QUIET_NAN:
     return T::quiet_nan(sign);
   }
-};
+}
 
 // Tests all properties for all types of float.
 TYPED_TEST(LlvmLibcFPBitsTest, Properties, FPTypes) {

diff  --git a/libc/test/src/sys/socket/linux/bind_test.cpp b/libc/test/src/sys/socket/linux/bind_test.cpp
index 305e4889f394e1..e70cbd578290ba 100644
--- a/libc/test/src/sys/socket/linux/bind_test.cpp
+++ b/libc/test/src/sys/socket/linux/bind_test.cpp
@@ -13,7 +13,6 @@
 #include "src/unistd/close.h"
 
 #include "src/errno/libc_errno.h"
-#include "test/UnitTest/LibcTest.h"
 #include "test/UnitTest/Test.h"
 
 #include <sys/socket.h> // For AF_UNIX and SOCK_DGRAM


        


More information about the libc-commits mailing list