Return-Path: Delivered-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Received: (qmail 68732 invoked from network); 29 Oct 2009 18:38:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Oct 2009 18:38:24 -0000 Received: (qmail 87547 invoked by uid 500); 29 Oct 2009 18:38:24 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 87475 invoked by uid 500); 29 Oct 2009 18:38:23 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 87465 invoked by uid 99); 29 Oct 2009 18:38:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2009 18:38:23 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2009 18:38:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7C92C234C04C for ; Thu, 29 Oct 2009 11:37:59 -0700 (PDT) Message-ID: <2032643853.1256841479508.JavaMail.jira@brutus> Date: Thu, 29 Oct 2009 18:37:59 +0000 (UTC) From: "Allen Wittenauer (JIRA)" To: mapreduce-issues@hadoop.apache.org Subject: [jira] Updated: (MAPREDUCE-1166) SerialUtils.cc: dynamic allocation of arrays based on runtime variable is not portable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MAPREDUCE-1166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allen Wittenauer updated MAPREDUCE-1166: ---------------------------------------- Attachment: (was: MAPREREDUCE-1166.patch) > SerialUtils.cc: dynamic allocation of arrays based on runtime variable is not portable > -------------------------------------------------------------------------------------- > > Key: MAPREDUCE-1166 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-1166 > Project: Hadoop Map/Reduce > Issue Type: Bug > Reporter: Allen Wittenauer > Attachments: MAPREREDUCE-1166.patch > > > 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.