kou commented on issue #2424:
URL: https://github.com/apache/arrow-adbc/issues/2424#issuecomment-2576781155

   This works but suppressing `-Wall0c-size` may be better...:
   
   ```diff
   diff --git a/c/validation/adbc_validation_statement.cc 
b/c/validation/adbc_validation_statement.cc
   index cd388623b..e47f183d4 100644
   --- a/c/validation/adbc_validation_statement.cc
   +++ b/c/validation/adbc_validation_statement.cc
   @@ -2817,8 +2817,9 @@ struct ADBC_EXPORT AdbcError100 {
    // Test that an ADBC 1.0.0-sized error still works
    void StatementTest::TestErrorCompatibility() {
      static_assert(sizeof(AdbcError100) == ADBC_ERROR_1_0_0_SIZE, "Wrong 
size");
   +  auto error_buffer = malloc(ADBC_ERROR_1_0_0_SIZE);
      // XXX: sketchy cast
   -  auto* error = reinterpret_cast<struct 
AdbcError*>(malloc(ADBC_ERROR_1_0_0_SIZE));
   +  auto* error = reinterpret_cast<struct AdbcError*>(error_buffer);
      std::memset(error, 0, ADBC_ERROR_1_0_0_SIZE);
    
      ASSERT_THAT(AdbcStatementNew(&connection, &statement, error), 
IsOkStatus(error));
   @@ -2831,7 +2832,7 @@ void StatementTest::TestErrorCompatibility() {
                  ::testing::Not(IsOkStatus(error)));
      auto* old_error = reinterpret_cast<AdbcError100*>(error);
      old_error->release(old_error);
   -  free(error);
   +  free(error_buffer);
    }
    
    void StatementTest::TestResultInvalidation() {
   ```


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to