Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-2393

[C++] arrow/status.h does not define ARROW_CHECK needed for ARROW_CHECK_OK

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.9.0
    • Fix Version/s: 0.10.0
    • Component/s: C++

      Description

      test.cpp

      #include <arrow/api.h>
      
      int main(void) {
      arrow::Int64Builder i64builder;
      std::shared_ptr<arrow::Array> i64array;
      ARROW_CHECK_OK(i64builder.Finish(&i64array));
      return EXIT_SUCCESS;
      }
      

      Attempt to build:

      $CXX test.cpp -std=c++11 -larrow
      

      Error:

      test.cpp:6:2: error: use of undeclared identifier 'ARROW_CHECK' ARROW_CHECK_OK(i64builder.Finish(&i64array)); ^ xxx/include/arrow/status.h:49:27: note: expanded from macro 'ARROW_CHECK_OK' #define ARROW_CHECK_OK(s) ARROW_CHECK_OK_PREPEND(s, "Bad status") ^ xxx/include/arrow/status.h:44:5: note: expanded from macro 'ARROW_CHECK_OK_PREPEND' ARROW_CHECK(_s.ok()) << (msg) << ": " << _s.ToString(); \ ^ 1 error generated.
      

      I expect that ARROW_* macro are public API, and should work out of the box.
      A naive attempt to fix it

      diff --git a/cpp/src/arrow/status.h b/cpp/src/arrow/status.h
      index 84f55e41..6da4a773 100644
      --- a/cpp/src/arrow/status.h
      +++ b/cpp/src/arrow/status.h
      @@ -25,6 +25,7 @@
      
       #include "arrow/util/macros.h"
       #include "arrow/util/visibility.h"
      +#include "arrow/util/logging.h"
      
       // Return the given status if it is not OK.
       #define ARROW_RETURN_NOT_OK(s)           \
      

      fails with

      public-api-test.cc:21:2: error: "DCHECK should not be visible from Arrow public headers."
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joshuastorck Joshua Storck
                Reporter:
                striderapache dennis lucero
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: