--- a/tiledb/sm/array_schema/enumeration.h
+++ b/tiledb/sm/array_schema/enumeration.h
@@ -278,7 +278,7 @@
              size of the buffer pointed to.
    */
   span<uint8_t> data() const {
-    return {static_cast<uint8_t*>(data_.data()), data_.size()};
+    return {static_cast<uint8_t*>(data_.data()), static_cast<unsigned int>(data_.size())};
   }
 
   /**
@@ -288,7 +288,7 @@
    *         the size of the buffer pointed to.
    */
   span<uint8_t> offsets() const {
-    return {static_cast<uint8_t*>(offsets_.data()), offsets_.size()};
+    return {static_cast<uint8_t*>(offsets_.data()), static_cast<unsigned int>(offsets_.size())};
   }
 
   /**
