]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/20_util/align/1.cc
libstdc++: Avoid warnings in tests
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / align / 1.cc
index 2fc1b6d1d9c3ec3c2f29a093e1c71989163dcc24..a08b0312fb91cdf2886a5f8d65da97fdc9d636c8 100644 (file)
@@ -30,6 +30,8 @@
 void
 test01()
 {
+  using std::size_t;
+
   size_t space = 100;
   void* ptr = new char[space];
   char* const orig_ptr = static_cast<char*>(ptr);
@@ -44,7 +46,7 @@ test01()
       uintptr_t p = reinterpret_cast<uintptr_t>(ptr);
       VERIFY( p % alignment == 0 );
       char* const x = static_cast<char*>(ptr);
-      VERIFY( x - old_ptr == old_space - space );
+      VERIFY( size_t(x - old_ptr) == old_space - space );
       VERIFY( (void*)x < (void*)(orig_ptr + orig_space) );
       VERIFY( (void*)(x + size) < (void*)(orig_ptr + orig_space) );
       ptr = x + size;