From e95fc02b8093dbdc955c52cae41f2546c59c388f Mon Sep 17 00:00:00 2001
From: David Li
Date: Mon, 14 Oct 2024 20:33:39 -0400
Subject: [PATCH 1/2] fix: remove deprecated operator"" syntax usage
Clang warns about this. Apparently GCC 4.9 may warn about the
fixed syntax, though!
---
src/nanoarrow/nanoarrow.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nanoarrow/nanoarrow.hpp b/src/nanoarrow/nanoarrow.hpp
index b9470bec9..9b50cd460 100644
--- a/src/nanoarrow/nanoarrow.hpp
+++ b/src/nanoarrow/nanoarrow.hpp
@@ -92,7 +92,7 @@ namespace literals {
/// @{
/// \brief User literal operator allowing ArrowStringView construction like "str"_asv
-inline ArrowStringView operator"" _asv(const char* data, std::size_t size_bytes) {
+inline ArrowStringView operator""_asv(const char* data, std::size_t size_bytes) {
return {data, static_cast(size_bytes)};
}
From 5b50a1c7c92c039d471c66e66a88acddf78cf5b6 Mon Sep 17 00:00:00 2001
From: David Li
Date: Tue, 15 Oct 2024 01:53:56 -0400
Subject: [PATCH 2/2] ifdef it instead
---
src/nanoarrow/nanoarrow.hpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/nanoarrow/nanoarrow.hpp b/src/nanoarrow/nanoarrow.hpp
index 9b50cd460..138a4ac10 100644
--- a/src/nanoarrow/nanoarrow.hpp
+++ b/src/nanoarrow/nanoarrow.hpp
@@ -92,9 +92,16 @@ namespace literals {
/// @{
/// \brief User literal operator allowing ArrowStringView construction like "str"_asv
+#if !defined(__clang__) && (defined(__GNUC__) && __GNUC__ < 6)
+inline ArrowStringView operator"" _asv(const char* data, std::size_t size_bytes) {
+ return {data, static_cast(size_bytes)};
+}
+#else
inline ArrowStringView operator""_asv(const char* data, std::size_t size_bytes) {
return {data, static_cast(size_bytes)};
}
+#endif
+// N.B. older GCC requires the space above, newer Clang forbids the space
// @}