From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id F1492ADB3 for ; Tue, 24 Feb 2015 12:12:55 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 24 Feb 2015 03:12:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,638,1418112000"; d="scan'208";a="656380343" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga001.jf.intel.com with ESMTP; 24 Feb 2015 03:12:54 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.69]) by irsmsx105.ger.corp.intel.com ([169.254.7.117]) with mapi id 14.03.0195.001; Tue, 24 Feb 2015 11:12:52 +0000 From: "Wodkowski, PawelX" To: Olivier MATZ , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/5] rte_timer: fix invalid declaration of rte_timer_cb_t Thread-Index: AQHQUB4kNnOX20x3+Ey7AKQTLPQqYJz/n8FA Date: Tue, 24 Feb 2015 11:12:52 +0000 Message-ID: References: <1424700600-1765-1-git-send-email-pawelx.wodkowski@intel.com> <1424700600-1765-2-git-send-email-pawelx.wodkowski@intel.com> <54EC54C5.2060002@6wind.com> In-Reply-To: <54EC54C5.2060002@6wind.com> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/5] rte_timer: fix invalid declaration of rte_timer_cb_t X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2015 11:12:56 -0000 > -----Original Message----- > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > Sent: Tuesday, February 24, 2015 11:39 AM > To: Wodkowski, PawelX; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 1/5] rte_timer: fix invalid declaration of > rte_timer_cb_t >=20 > Hi Pawel, >=20 > On 02/23/2015 03:09 PM, Pawel Wodkowski wrote: > > Declaration for function pointer should be > > typedef ret_type (*type_name)(args...) > > not > > typedef ret_type (type_name)(args...) > > > > although compiler treat both of them the same, the static analysis tool > > like klocwork complain about that. >=20 > Can you give some details about the reason why klocwork is > complaining? >=20 > Looking at the C11 standard, it seems that this syntax is > legal. Please see EXAMPLE 4, page 156 of: > http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1570.pdf >=20 Legal, might be. Problem is in using it. In struct rte_timer field 'f' if declared as pointer to rte_timer_cb_t but __rte_timer_reset() expects rte_timer_cb_t. This have a little impact to real code but it is inconsiste= nt with declaration, definition and rest of the library where first syntax is = used. There are some places where second declaration is used but its usage there is consistent with declaration. I looked at the code in rest of library and for consistency I changed typedef rather than function declaration. Pawel