apache / apache/arrow

[C++] Better handling `mem*` api that behave sanely on NULL input

Open
#44,814 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

I think we take a systematic approach to this and make wrappers to `mem*` functions that behave sanely on `NULL` input.

This article [1] discusses the issue in detail and points to approaches taken by projects like `boringssl`. [2] There is also a proposal from prolific LLVM contributors for fixing this at the C standard level. [3]

[1] https://davidben.net/2024/01/15/empty-slices.html
[2] https://boringssl.googlesource.com/boringssl/+/17cf2cb1d226b0ba2401304242df7ddd3b6f1ff2%5E%21/
[3] https://docs.google.com/document/d/1guH_HgibKrX7t9JfKGfWX2UCPyZOTLsnRfR6UleD1F8/edit?tab=t.0

_Originally posted by @felipecrv in https://github.com/apache/arrow/issues/44794#issuecomment-2494059369_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.