Jim Apple has uploaded this change for review. (
http://gerrit.cloudera.org:8080/11811
Change subject: IMPALA-5031: Zero-length arrays are undefined behavior
......................................................................
IMPALA-5031: Zero-length arrays are undefined behavior
This patch prevents the creation of a zero-length array. This is
illegal under paragraph 5 of §6.7.5.2 ("Array declarators") of the C99
standard, which reads:
If the size is an expression that is not an integer constant
expression: if it occurs in a declaration at function prototype
scope, it is treated as if it were replaced by *; otherwise, each
time it is evaluated it shall have a value greater than zero.
Variable-length arrays are not part of C++14, but they are a common
compiler extension and are available in both clang++ and g++. That the
semantics of missing features are the same is implied by [intro.scope]
in the C++14 standard, which reads:
C++ is a general purpose programming language based on the C
programming language as described in ISO/IEC 9899:1999 Programming
languages — C (hereinafter referred to as the C standard).
Change-Id: I93f7d0b0506e4b6a2ff3303477d887a428431f96
---
M be/src/runtime/row-batch-serialize-test.cc
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/11/11811/1
--
To view, visit http://gerrit.cloudera.org:8080/11811
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I93f7d0b0506e4b6a2ff3303477d887a428431f96
Gerrit-Change-Number: 11811
Gerrit-PatchSet: 1
Gerrit-Owner: Jim Apple <[email protected]>