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 82DDAA00C2 for ; Wed, 24 Aug 2022 11:58:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D6E540DFD; Wed, 24 Aug 2022 11:58:36 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id B28B440DDE for ; Wed, 24 Aug 2022 11:58:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661335114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VK9/BnHvz3myN9kNyxuNAkJ5rTRz0c0V+QX+Cdabjho=; b=c8oyOhNd0vgLuZL0GZtCQDrVn7neX1yE8bbMklSx21DKzhUZGsgGyouJa846x7mh6xQytT bF1vKDoxdUu5/blShPLSgjEjw591aveqskqoQIo5sIiszuPMeaNxhXH/SHRTYNXR1smbJS eZHcyGTvsEw+7/OVqgPMN0oXNysJY5U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-171-b02w8XpdObG3139R2B08jw-1; Wed, 24 Aug 2022 05:58:33 -0400 X-MC-Unique: b02w8XpdObG3139R2B08jw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0D5778032FB; Wed, 24 Aug 2022 09:58:33 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id CED5440CFD0A; Wed, 24 Aug 2022 09:58:31 +0000 (UTC) From: Kevin Traynor To: stable@dpdk.org Cc: bluca@debian.org, david.marchand@redhat.com, Kevin Traynor Subject: [PATCH 21.11] examples/performance-thread: fix build with GCC 12 Date: Wed, 24 Aug 2022 10:58:16 +0100 Message-Id: <20220824095816.1449620-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [1/2] Compiling C object examples/dpdk-pthrea... formance-thread_pthread_shim_pthread_shim.c.o ../examples/performance-thread/pthread_shim/pthread_shim.c: In function ‘pthread_setspecific’: ../examples/performance-thread/pthread_shim/pthread_shim.c:592:27: warning: ‘data’ may be used uninitialized [-Wmaybe-uninitialized] 592 | int rv = lthread_setspecific((unsigned int)key, data); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../examples/performance-thread/pthread_shim/pthread_shim.c:589:56: note: accessing argument 2 of a function declared with attribute ‘access (none, 2)’ 589 | int pthread_setspecific(pthread_key_t key, const void *data) | ~~~~~~~~~~~~^~~~ This is a false positive as pthread_setspecific() does not read from the (const void *) so we can squash the warning. performance-thread example is already removed from DPDK main branch. Signed-off-by: Kevin Traynor --- examples/performance-thread/pthread_shim/pthread_shim.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c index bbc076584b..a44cb8244d 100644 --- a/examples/performance-thread/pthread_shim/pthread_shim.c +++ b/examples/performance-thread/pthread_shim/pthread_shim.c @@ -587,4 +587,9 @@ pthread_t pthread_self(void) } +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + int pthread_setspecific(pthread_key_t key, const void *data) { @@ -596,4 +601,8 @@ int pthread_setspecific(pthread_key_t key, const void *data) } +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000) +#pragma GCC diagnostic pop +#endif + int pthread_spin_init(pthread_spinlock_t *a, int b) { -- 2.37.2