Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 73406 invoked from network); 10 Jun 2008 03:46:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jun 2008 03:46:35 -0000 Received: (qmail 26861 invoked by uid 500); 10 Jun 2008 03:46:38 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 26839 invoked by uid 500); 10 Jun 2008 03:46:38 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 26825 invoked by uid 99); 10 Jun 2008 03:46:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jun 2008 20:46:38 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Tue, 10 Jun 2008 03:45:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 00EA4234C135 for ; Mon, 9 Jun 2008 20:45:45 -0700 (PDT) Message-ID: <884071525.1213069544989.JavaMail.jira@brutus> Date: Mon, 9 Jun 2008 20:45:44 -0700 (PDT) From: "Dimuthu Gamage (JIRA)" To: axis-c-dev@ws.apache.org Subject: [jira] Resolved: (AXIS2C-1159) warning: 'k' is used uninitialized in this function In-Reply-To: <1222009234.1211471756578.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2C-1159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dimuthu Gamage resolved AXIS2C-1159. ------------------------------------ Resolution: Fixed Fixed in the latest svn. The intention of the check is to avoid setting NULL value if it makes the array size less than minOccurs. Since primitive values we don't have to check whether it is NULL, we don't need this check. And renamed the variable name 'k' to 'non_nil_count', so it is more readable. > warning: 'k' is used uninitialized in this function > --------------------------------------------------- > > Key: AXIS2C-1159 > URL: https://issues.apache.org/jira/browse/AXIS2C-1159 > Project: Axis2-C > Issue Type: Bug > Components: code generation > Affects Versions: 1.4.0 > Environment: linux fc5 > Reporter: Frederic Heem > > The warning "'k' is used uninitialized in this function" is much more than a warning, it's a real bug that will be hard to solved if not cured correclty. > Here is the piece of WSDL that cause the problem: > > > > > > > > This is the generated code: > axis2_status_t AXIS2_CALL > adb_ActiveEndpointResponseParam_set_activeEndpoint_at( > adb_ActiveEndpointResponseParam_t* _ActiveEndpointResponseParam, > const axutil_env_t *env, int i, > const unsigned short arg_activeEndpoint) > { > void *element = NULL; > int size = 0; > int j; > int k; > axis2_bool_t non_nil_exists = AXIS2_FALSE; > unsigned short* ptr_param_activeEndpoint; > > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > AXIS2_PARAM_CHECK(env->error, _ActiveEndpointResponseParam, AXIS2_FAILURE); > > if( _ActiveEndpointResponseParam->is_valid_activeEndpoint && > _ActiveEndpointResponseParam->property_activeEndpoint && > > arg_activeEndpoint == *((unsigned short*)axutil_array_list_get(_ActiveEndpointResponseParam->property_activeEndpoint, env, i))) > > { > > return AXIS2_SUCCESS; > } > > non_nil_exists = AXIS2_TRUE; /* no way to check for nill for each elements for primitive types */ > > if( k < 0) > { > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Size of the array of activeEndpoint is beinng set to be smaller than the specificed number of minOccurs(0)"); > return AXIS2_FAILURE; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-dev-help@ws.apache.org