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 13C5343EF8; Wed, 24 Apr 2024 18:13:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2873402D4; Wed, 24 Apr 2024 18:13:57 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 32327402D1 for ; Wed, 24 Apr 2024 18:13:56 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1e8f68f8e0dso36769375ad.3 for ; Wed, 24 Apr 2024 09:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713975235; x=1714580035; 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=ZYKy3liYl5b6fYVJSFS66tnOB61XbWYpXAbDGJ7i8ak=; b=NvaoWTkKFjWdkk30yiJnJLK0cQ/h2GmGbCxmHqBzieDqXXEToarFCNcvYu1kP/b5vL jdrhvh4beMMC/1EtWwUEwt2kJm4uPd5ef7VgAwI72R9vUg8O3AupgrTuCXoO/6gi+13r gWKDV4Am/ZoOl1BWNmzSXusiAYdokNjlyL2tGWBvinV8FajvTw/9CPQ2EpVKzvyFiesS 7wICpBAkMY7pfQLhxZ392EzukMKmrcVswrQIf62zeSwJIDtlQMJ0420RJ1KJoAPIMTgu j7Zq/KNljPDIrNhI0rDuNwq+dN/eCzHHraKA5ChrpXh8q98qFK3kbeYTNNdSixHEQvop qg9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713975235; x=1714580035; 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=ZYKy3liYl5b6fYVJSFS66tnOB61XbWYpXAbDGJ7i8ak=; b=ebIKUDTTK+RPqXx6082ma6++PvUqGYRWmpZ/Eq6puj56avASmiS8/H16cjcj/UvuQu aJDD7NUZUKcohXaZQQPUngD1Jsvl1VlR7XAr0cDksUUaeVROlIw+gVppGu7vZ+d6uWOm p3epOKA04RGrKnq+XhsaRrPJbXYuKfi4gaNmevJudz90ADuXGumm4+K8z/65SD3sLMku HOhVOMM+UPosgaVRYM2pFWbIFVQxE704EkMQTvT4KIJSP0YwhlZt+DmVXObzmyA7OOZ0 b5V6KAapEQpmMqrnRgSfRF7Lbsx9wxQDNq6ZK/9NcOXLriuryIa1HPfzt6c0fvqtWefP 61jg== X-Gm-Message-State: AOJu0Yxdzr8jhd1yf1U4bJ8Yu0nbPUck4LFX4QZ/3tBWQjCMCqwDRd7B Y2iMhCHp9xMfdIKujO5XgfqtlU8Ies8qDOnOqcE7Ez/TCUohkzatzUncSQu7p/4= X-Google-Smtp-Source: AGHT+IFK6/Y8BXAJuo8PPZbUaJUSwNewDphiH+wlaRpeueDbrK8xP9UiUBPH0hSEzo0fQxbXSPxXqw== X-Received: by 2002:a17:902:c944:b0:1e4:12f0:d7c9 with SMTP id i4-20020a170902c94400b001e412f0d7c9mr3508865pla.11.1713975235031; Wed, 24 Apr 2024 09:13:55 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id u1-20020a170902e80100b001e4344a7601sm12127489plg.42.2024.04.24.09.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 09:13:54 -0700 (PDT) Date: Wed, 24 Apr 2024 09:13:52 -0700 From: Stephen Hemminger To: "Van Haaren, Harry" Cc: "dev@dpdk.org" , "Richardson, Bruce" , Jerin Jacob Subject: Re: [PATCH] event: fix warning from useless snprintf Message-ID: <20240424091352.0eb5d141@hermes.local> In-Reply-To: References: <20240424034541.134335-1-stephen@networkplumber.org> 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 Wed, 24 Apr 2024 08:45:52 +0000 "Van Haaren, Harry" wrote: > > From: Stephen Hemminger > > Sent: Wednesday, April 24, 2024 4:45 AM > > To: dev@dpdk.org > > Cc: Richardson, Bruce; Stephen Hemminger; Van Haaren, Harry; Jerin Jacob > > Subject: [PATCH] event: fix warning from useless snprintf > > > > With Gcc-14, this warning is generated: > > ../drivers/event/sw/sw_evdev.c:263:3: warning: 'snprintf' will always be truncated; > > specified size is 12, but format string expands to at least 13 [-Wformat-truncation] > > 263 | snprintf(buf, sizeof(buf), "sw%d_iq_%d_rob", dev_id, i); > > | ^ > > > > Yet the whole printf to the buf is unnecessary. The type string argument > > has never been implemented, and should just be NULL. Removing the > > unnecessary snprintf, then means IQ_ROB_NAMESIZE can be removed. > > I understand that today the "type" value isn't implemented, but across the DPDK codebase it > seems like others are filling in "type" to be some debug-useful name/string. If it was added > in future it'd be nice to have the ROB/IQ memory identified by name, like the rest of DPDK components. No, don't bother. This is a case of https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it There are better ways of tracking allocations like ASAN. There are better memory allocators as well which use something different.