[v2,3/3] app/test-pipeline: fix building with GCC 10

Message ID 5de9fca287dbda831bbe11e34ecf89631e3a812f.1580911676.git.tredaelli@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series examples: fix building with GCC 10 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Timothy Redaelli Feb. 5, 2020, 2:12 p.m. UTC
  GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: 48f31ca50cc4 ("app/pipeline: packet framework benchmark")
Cc: cristian.dumitrescu@intel.com
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---

v2:
    app is already declared as extern in main.h. (as reported by David)

---
 app/test-pipeline/config.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Cristian Dumitrescu Feb. 5, 2020, 2:21 p.m. UTC | #1
> -----Original Message-----
> From: Timothy Redaelli <tredaelli@redhat.com>
> Sent: Wednesday, February 5, 2020 2:12 PM
> To: stable@dpdk.org
> Cc: dev@dpdk.org; david.marchand@redhat.com; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Subject: [PATCH v2 3/3] app/test-pipeline: fix building with GCC 10
> 
> GCC 10 defaults to -fno-common, this means a linker error will now be
> reported if the same global variable is defined in more than one
> compilation unit.
> 
> Fixes: 48f31ca50cc4 ("app/pipeline: packet framework benchmark")
> Cc: cristian.dumitrescu@intel.com
> Cc: stable@dpdk.org
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---
> 
> v2:
>     app is already declared as extern in main.h. (as reported by David)
> 
> ---
>  app/test-pipeline/config.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c
> index 28ac9fcc0..33f3f1c82 100644
> --- a/app/test-pipeline/config.c
> +++ b/app/test-pipeline/config.c
> @@ -42,8 +42,6 @@
> 
>  #include "main.h"
> 
> -struct app_params app;
> -
>  static const char usage[] = "\n";
> 
>  void
> --
> 2.24.1

Yes, app is declared in main.h and defined & initialized in init.c, no need to have it defined the second time in config.c.

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
  

Patch

diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c
index 28ac9fcc0..33f3f1c82 100644
--- a/app/test-pipeline/config.c
+++ b/app/test-pipeline/config.c
@@ -42,8 +42,6 @@ 
 
 #include "main.h"
 
-struct app_params app;
-
 static const char usage[] = "\n";
 
 void