You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/02 18:03:53 UTC

[GitHub] [arrow] wesm commented on a change in pull request #7330: ARROW-8951: [C++] Fix compiler warnings on gcc8 in release builds

wesm commented on a change in pull request #7330:
URL: https://github.com/apache/arrow/pull/7330#discussion_r434071547



##########
File path: cpp/src/arrow/util/time.h
##########
@@ -34,16 +34,8 @@ enum DivideOrMultiply {
 };
 
 // TimestampType -> TimestampType
-static std::pair<DivideOrMultiply, int64_t> kTimestampConversionTable[4][4] = {
-    // TimestampType::SECOND
-    {{MULTIPLY, 1}, {MULTIPLY, 1000}, {MULTIPLY, 1000000}, {MULTIPLY, 1000000000}},
-    // TimestampType::MILLI
-    {{DIVIDE, 1000}, {MULTIPLY, 1}, {MULTIPLY, 1000}, {MULTIPLY, 1000000}},
-    // TimestampType::MICRO
-    {{DIVIDE, 1000000}, {DIVIDE, 1000}, {MULTIPLY, 1}, {MULTIPLY, 1000}},
-    // TimestampType::NANO
-    {{DIVIDE, 1000000000}, {DIVIDE, 1000000}, {DIVIDE, 1000}, {MULTIPLY, 1}},
-};
+ARROW_EXPORT extern const std::pair<DivideOrMultiply, int64_t>
+    kTimestampConversionTable[4][4];

Review comment:
       I see, I wasn't aware that accessing this matrix happened on a hot path. I'll see if making it constexpr fixes the warning otherwise I'll let it go




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org