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

Message ID f1efc1effdca7f37ba21bdccbe5d711987a64635.1580906522.git.tredaelli@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series fix building with GCC 10 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Timothy Redaelli Feb. 5, 2020, 12:50 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>
---
 app/test-pipeline/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand Feb. 5, 2020, 1:26 p.m. UTC | #1
On Wed, Feb 5, 2020 at 1:51 PM Timothy Redaelli <tredaelli@redhat.com> wrote:
>
> 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>
> ---
>  app/test-pipeline/config.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c
> index 28ac9fcc0..42c6ed9b2 100644
> --- a/app/test-pipeline/config.c
> +++ b/app/test-pipeline/config.c
> @@ -42,7 +42,7 @@
>
>  #include "main.h"
>
> -struct app_params app;
> +extern struct app_params app;

app is already declared as extern in main.h.


--
David Marchand
  

Patch

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