eddelbuettel opened a new issue, #35617:
URL: https://github.com/apache/arrow/issues/35617

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   This is something spotted by `gcc-12` as I was working around the C API 
examples.  When (near the very bottom of the [C API 
documentation](https://arrow.apache.org/docs/format/CDataInterface.html)) the 
example allocates buffers, it references the parent structure in
   
   ```c
   malloc(sizeof(void*) * array->n_buffers);
   ```
   
   This should be 
   
   ```c
   malloc(sizeof(void*) * child->n_buffers);
   ```
   
   in both cases, and `child` is updated just above with `n_buffers` being 2 
and 3, respectively, as opposed to the 1 from the parent.   
   
   Making the change makes the nags
   
         warning: array subscript 1 is outside array bounds of ‘void[8]'
   
         note: at offset 8 into object of size 8 allocated by ‘malloc’ 
         
   go away.  I can send a PR if it helps as I have this updated in a fork.
   
   ### Component(s)
   
   C, Documentation, Website


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