From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A9542432CD; Wed, 8 Nov 2023 03:31:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2183940DDC; Wed, 8 Nov 2023 03:31:19 +0100 (CET) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) by mails.dpdk.org (Postfix) with ESMTP id 9267940041 for ; Wed, 8 Nov 2023 03:31:17 +0100 (CET) Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3b5ff072fc4so1222665b6e.3 for ; Tue, 07 Nov 2023 18:31:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699410676; x=1700015476; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=R9P7wse0ag3svl83TTR2CljaqRB8D4s09/5FRzi35Mg=; b=lid/A38TNrpP4EnvDlVTV2aZcHTJ5w5UoPpf06HV+IwgzfQWtsyVvg3qW09X2lXZlD Q95oiptvVdFmJR4WHYC9pIsu13Op5WyEpNySHFufR8Hz++z3BIpVqKRHSDM3OL3QF4Np a+eQMyumQqCeG+oso4Ld5UdoT7EEha3RiVsIHaka1j32yocZ7TG/uRO++EP3vVm8FSLK B4XPFdTWp7TMNnlULQA9Ej8W2isnBpOPI03HHtZEd3SuOZUNrZ5mH7sGy27aC4N4FCu5 4EjY+FFcdMMraE/YP8Vhc/aEX40tKHUe1d061fyfw9VDr6KohsYnWjMQUeCH9m1A+3ed yU4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699410677; x=1700015477; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R9P7wse0ag3svl83TTR2CljaqRB8D4s09/5FRzi35Mg=; b=ig1ydXn58ISETInY5REwisTU8MsHBV1bo/uMYXQ4lgZFJaOjiTeb0f0W5V8lX7ViA2 Ul88v30nAISexfaeniYGzvhOi6a83hHbTKIfDkZfvN1Pq3WgZK3KO2KL34+vouGkQ4tc S3/37vVDqO7SWLzTxCGVurU7C9KsCHgev1PK9a++pkRPKFmPLmLmcUjBADm4a5+DyH+M seE9ZWRSC0nFbvvDHsK6gHl4zDE1dpPzXqlcZKeLmo+xC2dlft/J4BPnqAwllmj/GrtR 4BjZGdWU7F/dUgHZUI6SNvcYSYBgCQx9JGkOt5eFel1cuwH4GBIIksEDt4hBX7wpRVkj camA== X-Gm-Message-State: AOJu0YyqKH3OtijYNema4aK+D3GeewtQZCl/KGqvLwTXdQ161zZMwkYM 8fttzhUvRGbqI50Ttm3kIIpbKA== X-Google-Smtp-Source: AGHT+IGbEu0qpjbs2ifxcRBhiwiDNvzUFEYwZkFgJfg3zz0AUDunJl/3FpSndrkXnP2BuFcwutsj4g== X-Received: by 2002:a05:6808:1a18:b0:3ae:16b6:6346 with SMTP id bk24-20020a0568081a1800b003ae16b66346mr1050782oib.7.1699410676740; Tue, 07 Nov 2023 18:31:16 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id gu17-20020a056a004e5100b0068c10187dc3sm7864395pfb.168.2023.11.07.18.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 18:31:16 -0800 (PST) Date: Tue, 7 Nov 2023 18:31:14 -0800 From: Stephen Hemminger To: Tyler Retzlaff Cc: dev@dpdk.org Subject: Re: RFC acceptable handling of VLAs across toolchains Message-ID: <20231107183114.330c2d8e@hermes.local> In-Reply-To: <20231107193220.GA15232@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20231107193220.GA15232@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 7 Nov 2023 11:32:20 -0800 Tyler Retzlaff wrote: > hi folks, > > i'm seeking advice. we have use of VLAs which are now optional in > standard C. some toolchains provide a conformant implementation and msvc > does not (and never will). > > we seem to have a few options, just curious about what people would > prefer. > > * use alloca > > * use dynamically allocated storage > > * conditional compiled code where the msvc leg uses one of the previous > two options > > i'll leave it simple for now, i'd like to hear input rather than provide > a recommendation for now. > VLAs are a bug magnet. Best to avoid them, most code doesn't need them. The one common use case is code that accepts a burst of packets. But such code could easily have an upper bound if necessary. Please don't add more to the maze of #ifdef's