FAQ
SerialUtils.cc: dynamic allocation of arrays based on runtime variable is not portable
--------------------------------------------------------------------------------------

Key: HADOOP-6263
URL: https://issues.apache.org/jira/browse/HADOOP-6263
Project: Hadoop Common
Issue Type: Bug
Reporter: Allen Wittenauer


In SerialUtils.cc, the following code appears:

int len;
if (b < -120) {
negative = true;
len = -120 - b;
} else {
negative = false;
len = -112 - b;
}
uint8_t barr[len];


as far as I'm aware, this is not legal in ANSI C and will be rejected by ANSI compliant compilers. Instead, this should be malloc()'d based upon the size of len and free()'d later.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedSep 16, '09 at 10:38p
activeSep 16, '09 at 10:38p
posts1
users1
websitehadoop.apache.org...
irc#hadoop

1 user in discussion

Allen Wittenauer (JIRA): 1 post

People

Translate

site design / logo © 2021 Grokbase