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

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

Checks

Context Check Description
ci/checkpatch success coding style OK
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: 08e0c7581468 ("test/fib: add performance autotests")
Cc: vladimir.medvedkin@intel.com
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 app/test/test_fib_perf.c | 2 +-
 app/test/test_lpm_perf.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Vladimir Medvedkin Feb. 5, 2020, 1:41 p.m. UTC | #1
On 05/02/2020 12:50, Timothy Redaelli 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: 08e0c7581468 ("test/fib: add performance autotests")
> Cc: vladimir.medvedkin@intel.com
> Cc: stable@dpdk.org
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---
>   app/test/test_fib_perf.c | 2 +-
>   app/test/test_lpm_perf.c | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/app/test/test_fib_perf.c b/app/test/test_fib_perf.c
> index 573087c3c..dd2e54db8 100644
> --- a/app/test/test_fib_perf.c
> +++ b/app/test/test_fib_perf.c
> @@ -35,7 +35,7 @@ struct route_rule {
>   	uint8_t depth;
>   };
>   
> -struct route_rule large_route_table[MAX_RULE_NUM];
> +static struct route_rule large_route_table[MAX_RULE_NUM];
>   
>   static uint32_t num_route_entries;
>   #define NUM_ROUTE_ENTRIES num_route_entries
> diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
> index a2578fe90..489719c40 100644
> --- a/app/test/test_lpm_perf.c
> +++ b/app/test/test_lpm_perf.c
> @@ -34,7 +34,7 @@ struct route_rule {
>   	uint8_t depth;
>   };
>   
> -struct route_rule large_route_table[MAX_RULE_NUM];
> +static struct route_rule large_route_table[MAX_RULE_NUM];
>   
>   static uint32_t num_route_entries;
>   #define NUM_ROUTE_ENTRIES num_route_entries
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
  

Patch

diff --git a/app/test/test_fib_perf.c b/app/test/test_fib_perf.c
index 573087c3c..dd2e54db8 100644
--- a/app/test/test_fib_perf.c
+++ b/app/test/test_fib_perf.c
@@ -35,7 +35,7 @@  struct route_rule {
 	uint8_t depth;
 };
 
-struct route_rule large_route_table[MAX_RULE_NUM];
+static struct route_rule large_route_table[MAX_RULE_NUM];
 
 static uint32_t num_route_entries;
 #define NUM_ROUTE_ENTRIES num_route_entries
diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
index a2578fe90..489719c40 100644
--- a/app/test/test_lpm_perf.c
+++ b/app/test/test_lpm_perf.c
@@ -34,7 +34,7 @@  struct route_rule {
 	uint8_t depth;
 };
 
-struct route_rule large_route_table[MAX_RULE_NUM];
+static struct route_rule large_route_table[MAX_RULE_NUM];
 
 static uint32_t num_route_entries;
 #define NUM_ROUTE_ENTRIES num_route_entries