From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BEFCCA00C3; Thu, 14 May 2020 02:43:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6D7111D649; Thu, 14 May 2020 02:43:39 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id 7C3B61D647 for ; Thu, 14 May 2020 02:43:38 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id w10so1644270ljo.0 for ; Wed, 13 May 2020 17:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q9yZWlnHAq3nfilgiZqNIPzbSCHg1JCN7MlYBTEo0Zs=; b=tk1MH/rEWA8In9nL39LnAMUhDFK9FD2WbxjgUSmrmc+gwAJL5M+jRb6UvaNiqMb4pe pB22Rh8Z3oRIuPYQsjntuOsmHpVF0005TqnprzzuLFR3LH22s7e+XjVDmqOE8DS/VX4f FJxIl90W3rYwrSN117LgjBpkxZK0AgGFsIQ+dhvNxk3JzjYcX2wDHIZt7AalvtC+pdIl t4rDW4v9rEvA8E2CfKB4KzcHjIILw/JPRV1oH3U5snljaJdgYJWC8TUhMZHWW8vJ0oYm ueUnQ2XycPFCkMNIVPnAigH346d7IaCzpLWyYsJfx9Qzxa290Jz7tRMm0DOXF5ALnRtc hoDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q9yZWlnHAq3nfilgiZqNIPzbSCHg1JCN7MlYBTEo0Zs=; b=eoknXLtkuQNFR1GzOjAzhxzaunO0td+VAf993SwgvoWlpo8UH5iNLryjFaS06CDjNQ kbYt7XHES57fI4yvKmDlRNmCfvES4Almy/jKloXEkXjT8oJVwjts+vRbC+szW+PkYezp 8lH4ulniPNpkmKl3YXaneKprj+9WJCQelbrE/nJ4pso5EN5MgQ1HqXDHkR1qKJdOS463 IM24pb2DqOmXuX2k2IPYjtOl0QHZLMIgzvwS0/uCjRWgBdrILfcxF3xuK4wpvuQSURBZ vo+5ulJDUhCW3Qr1xJqHkNZZcnzUH9ayUNlPpi/hbeMMYwl7IRwA4PhfZ0ik5uCxuIZ2 A1bA== X-Gm-Message-State: AOAM532oSuaWMQe3CVLMnfUNgjbY4WmSAOe3/5KDus/TcNREIkTUkB6c t7CCC0oRX1kguJbitnO8qVM= X-Google-Smtp-Source: ABdhPJysCmDhDBM0Y92JJaK2wiRuoXiFT3B853hSsjUgAP20ERFOODGIqDjX8pEtVvzuzgpCMJ8P+A== X-Received: by 2002:a2e:a556:: with SMTP id e22mr1033918ljn.130.1589417017998; Wed, 13 May 2020 17:43:37 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id s8sm659293lfd.61.2020.05.13.17.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 17:43:37 -0700 (PDT) Date: Thu, 14 May 2020 03:43:36 +0300 From: Dmitry Kozlyuk To: Pallavi Kadam Cc: dev@dpdk.org, thomas@monjalon.net, ranjit.menon@intel.com Message-ID: <20200514034336.77a02b8b@sovereign> In-Reply-To: <20200513225341.7620-1-pallavi.kadam@intel.com> References: <20200513225341.7620-1-pallavi.kadam@intel.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: fix warnings on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 13 May 2020 15:53:41 -0700 Pallavi Kadam wrote: > This patch fixes bunch of warnings when compiling on Windows > such as the use of an unsafe string function (strerror), > [-Wunused-const-variable] in getopt.c and > [-Wunused-variable], [-Wunused-function] in eal_common_options.c > > Signed-off-by: Ranjit Menon > Signed-off-by: Pallavi Kadam > Tested-by: Pallavi Kadam > --- > lib/librte_eal/common/eal_common_options.c | 6 +++++- > lib/librte_eal/windows/getopt.c | 4 ++-- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_options.c > b/lib/librte_eal/common/eal_common_options.c index > 8f2cbd1c6..2efbf59e4 100644 --- > a/lib/librte_eal/common/eal_common_options.c +++ > b/lib/librte_eal/common/eal_common_options.c @@ -115,8 +115,10 @@ > struct shared_driver { static struct shared_driver_list solib_list = > TAILQ_HEAD_INITIALIZER(solib_list); > > +#ifndef RTE_EXEC_ENV_WINDOWS > /* Default path of external loadable drivers */ > static const char *default_solib_dir = RTE_EAL_PMD_PATH; > +#endif > > /* > * Stringified version of solib path used by dpdk-pmdinfo.py > @@ -329,6 +331,7 @@ eal_plugin_add(const char *path) > return 0; > } > > +#ifndef RTE_EXEC_ENV_WINDOWS > static int > eal_plugindir_init(const char *path) > { > @@ -362,6 +365,7 @@ eal_plugindir_init(const char *path) > /* XXX this ignores failures from readdir() itself */ > return (dent == NULL) ? 0 : -1; > } > +#endif This causes different warnings: In file included from ../../../lib/librte_eal/common/eal_common_options.c:21: At top level: ../../../lib/librte_eal/windows/include/dirent.h:529:1: warning: 'closedir' defined but not used [-Wunused-function] 529 | closedir(DIR *dirp) | ^~~~~~~~ ../../../lib/librte_eal/windows/include/dirent.h:447:1: warning: 'readdir' defined but not used [-Wunused-function] 447 | readdir(DIR *dirp) | ^~~~~~~ ../../../lib/librte_eal/windows/include/dirent.h:377:1: warning: 'opendir' defined but not used [-Wunused-function] 377 | opendir(const char *dirname) | ^~~~~~~ Suggesting not to include to this file on Windows (this makes dirent.h unused in EAL, but other code will require it later). > > int > eal_plugins_init(void) > @@ -394,8 +398,8 @@ eal_plugins_init(void) > } > > } > - return 0; > #endif > + return 0; > } > > /* > diff --git a/lib/librte_eal/windows/getopt.c > b/lib/librte_eal/windows/getopt.c index 170c9b5e0..a08f7c109 100644 > --- a/lib/librte_eal/windows/getopt.c > +++ b/lib/librte_eal/windows/getopt.c > @@ -25,8 +25,8 @@ int opterr = 1; /* if error > message should be printed */ int optind = 1; /* > index into parent argv vector */ int optopt = '?'; > /* character checked for validity */ > -static void pass(void) {} > -#define warnx(a, ...) pass() > +static void pass(const char *a) {(void) a; } > +#define warnx(a, ...) pass(a) > > #define PRINT_ERROR ((opterr) && (*options != ':')) > Testing with MinGW-w64 (Ubuntu 19.10, package 6.0.0-3, GCC 9.2.1) reveals additional warnings. Never mind fixing them in a separate patch to avoid blocking this one. For the record: ../../../lib/librte_eal/common/eal_common_thread.c:180:25: warning: unused parameter 'attr' [-Wunused-parameter] ../../../lib/librte_eal/windows/eal_lcore.c:30:1: warning: old-style function definition [-Wold-style-definition] 30 | eal_create_cpu_map() ../../../lib/librte_eal/windows/eal_thread.c:149:29: warning: cast between incompatible function types from '__attribute__((noreturn)) void * (*)(void *)' to 'DWORD (*)(void *)' {aka 'long unsigned int (*)(void * '} [-Wcast-function-type] 149 | th = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)eal_thread_loop, ../../../lib/librte_eal/windows/eal.c:144:1: warning: 'optnone' attribute directive ignored [-Wattributes] ../../../lib/librte_eal/common/eal_common_options.c: In function 'eal_adjust_config': ../../../lib/librte_eal/windows/include/sched.h:63:55: warning: 'default_set._bits[1]' may be used uninitialized in this function [-Wmaybe-uninitialized] 63 | (dst)->_bits[_i] = (src1)->_bits[_i] & (src2)->_bits[_i]; \ -- Dmitry Kozlyuk