From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <SRS0+lY+I=O5=ericsson.com=mattias.ronnblom@lysator.liu.se>
Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3])
 by dpdk.org (Postfix) with ESMTP id 250381BAE5
 for <dev@dpdk.org>; Thu, 20 Dec 2018 11:54:01 +0100 (CET)
Received: from mail.lysator.liu.se (localhost [127.0.0.1])
 by mail.lysator.liu.se (Postfix) with ESMTP id 973A540018
 for <dev@dpdk.org>; Thu, 20 Dec 2018 11:54:00 +0100 (CET)
Received: by mail.lysator.liu.se (Postfix, from userid 1004)
 id 8497040014; Thu, 20 Dec 2018 11:54:00 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on
 bernadotte.lysator.liu.se
X-Spam-Level: 
X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL
 autolearn=disabled version=3.4.1
X-Spam-Score: -0.9
Received: from [192.168.1.59] (host-90-232-140-56.mobileonline.telia.com
 [90.232.140.56])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.lysator.liu.se (Postfix) with ESMTPSA id 3983340011;
 Thu, 20 Dec 2018 11:53:59 +0100 (CET)
To: Thomas Monjalon <thomas@monjalon.net>, Jason Messer <jmesser@microsoft.com>
Cc: dev@dpdk.org, Jeff Shaw <jeffrey.b.shaw@intel.com>,
 stephen@networkplumber.org, harini.ramakrishnan@microsoft.com
References: <20181214163827.9403-1-jeffrey.b.shaw@intel.com>
 <20181214190713.GB9964@ae13-28.jf.intel.com>
 <3a573b56-6ea0-812c-4641-830fbd3c59cc@ericsson.com> <27594774.hr4jPcleJC@xps>
From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= <mattias.ronnblom@ericsson.com>
Message-ID: <be3930f2-3931-e9e8-4311-65479ffc5a9c@ericsson.com>
Date: Thu, 20 Dec 2018 11:53:58 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <27594774.hr4jPcleJC@xps>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: ClamAV using ClamSMTP
Subject: Re: [dpdk-dev] [PATCH] eal: remove variable length array
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 20 Dec 2018 10:54:01 -0000

On 2018-12-19 22:45, Thomas Monjalon wrote:
> 14/12/2018 21:28, Mattias Rönnblom:
>> On 2018-12-14 20:07, Jeff Shaw wrote:
>>>>> The code prior to this commit produced the following warning when
>>>>> compiled with "-Wvla -std=c90".
>>>>>
>>>>>      warning: ISO C90 forbids variable length array ‘array’ [-Wvla]
>>>>>
>>>>> This commit removes the variable length array from the PMD debug
>>>>> trace function by allocating memory dynamically on the stack using
>>>>> alloca().
>>>>
>>>> Is alloca() even included in *any* C standard? As far as I see, it just
>>>> achieves the same thing in an uglier, less portable way than VLAs.
>>>
>>> I agree that it is much less elegant than a VLA. This is in preparation
>>> for DPDK on Windows, which using the Microsoft Visual C++ (MSVC) compiler.
>>> MSVC does not support variable length arrays. It does, however, support
>>> alloca(), as does GCC/ICC.
>>>
>>> For this particular instance, the point is moot, since the function is
>>> not used anywhere and can just as easily be removed. Though it does not
>>> address the issue for the ~100 other instances where VLAs are used. We
>>> will be submitting patches for those as more common files are ported to
>>> Windows.
>>
>> If Microsoft's C compiler doesn't support C99, some 20 years after its
>> release, maybe it's time to find a new compiler, instead of messing up
>> the DPDK code in a ~100 instances.
> 
> If think there is no reasonnable compiler for Windows.
> Yes I know, it's crazy.
> 
With's wrong with the Windows version of Clang?