[dpdk-dev,v2] examples/ip_pipeline: fix build error for gcc 4.8

Message ID 1466501740-28237-1-git-send-email-danielx.t.mrzyglod@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Commit Message

Daniel Mrzyglod June 21, 2016, 9:35 a.m. UTC
  This patch fixes a maybe-uninitialized warning when compiling DPDK with GCC 4.8

examples/ip_pipeline/pipeline/pipeline_common_fe.c: In function 'app_pipeline_track_pktq_out_to_link':
examples/ip_pipeline/pipeline/pipeline_common_fe.c:66:31: error:
'reader' may be used uninitialized in this function [-Werror=maybe-uninitialized]

   struct app_pktq_out_params *pktq_out =

Fixes: 760064838ec0 ("examples/ip_pipeline: link routing output ports to devices")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/ip_pipeline/app.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Cristian Dumitrescu June 21, 2016, 5:43 p.m. UTC | #1
> -----Original Message-----
> From: Mrzyglod, DanielX T
> Sent: Tuesday, June 21, 2016 10:36 AM
> To: Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; Mrzyglod, DanielX T <danielx.t.mrzyglod@intel.com>
> Subject: [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8
> 
> This patch fixes a maybe-uninitialized warning when compiling DPDK with
> GCC 4.8
> 
> examples/ip_pipeline/pipeline/pipeline_common_fe.c: In function
> 'app_pipeline_track_pktq_out_to_link':
> examples/ip_pipeline/pipeline/pipeline_common_fe.c:66:31: error:
> 'reader' may be used uninitialized in this function [-Werror=maybe-
> uninitialized]
> 
>    struct app_pktq_out_params *pktq_out =
> 
> Fixes: 760064838ec0 ("examples/ip_pipeline: link routing output ports to
> devices")
> 
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> ---
>  examples/ip_pipeline/app.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
> index 7611341..242dae8 100644
> --- a/examples/ip_pipeline/app.h
> +++ b/examples/ip_pipeline/app.h
> @@ -667,11 +667,11 @@ app_swq_get_reader(struct app_params *app,
>  	struct app_pktq_swq_params *swq,
>  	uint32_t *pktq_in_id)
>  {
> -	struct app_pipeline_params *reader;
> +	struct app_pipeline_params *reader = NULL;
>  	uint32_t pos = swq - app->swq_params;
>  	uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
>  		RTE_DIM(app->pipeline_params));
> -	uint32_t n_readers = 0, id, i;
> +	uint32_t n_readers = 0, id = 0, i;
> 
>  	for (i = 0; i < n_pipelines; i++) {
>  		struct app_pipeline_params *p = &app->pipeline_params[i];
> @@ -727,11 +727,11 @@ app_tm_get_reader(struct app_params *app,
>  	struct app_pktq_tm_params *tm,
>  	uint32_t *pktq_in_id)
>  {
> -	struct app_pipeline_params *reader;
> +	struct app_pipeline_params *reader = NULL;
>  	uint32_t pos = tm - app->tm_params;
>  	uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
>  		RTE_DIM(app->pipeline_params));
> -	uint32_t n_readers = 0, id, i;
> +	uint32_t n_readers = 0, id = 0, i;
> 
>  	for (i = 0; i < n_pipelines; i++) {
>  		struct app_pipeline_params *p = &app->pipeline_params[i];
> --
> 2.5.5


No need for this patch, as these fixes have been already applied by Ethan's patch. 

Daniel, please check and let us know if otherwise.
  
Daniel Mrzyglod June 22, 2016, 8:44 a.m. UTC | #2
>-----Original Message-----
>From: Dumitrescu, Cristian
>Sent: Tuesday, June 21, 2016 7:44 PM
>To: Mrzyglod, DanielX T <danielx.t.mrzyglod@intel.com>; Singh, Jasvinder
><jasvinder.singh@intel.com>
>Cc: dev@dpdk.org
>Subject: RE: [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8
>
>
>
>> -----Original Message-----
>> From: Mrzyglod, DanielX T
>> Sent: Tuesday, June 21, 2016 10:36 AM
>> To: Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian
>> <cristian.dumitrescu@intel.com>
>> Cc: dev@dpdk.org; Mrzyglod, DanielX T <danielx.t.mrzyglod@intel.com>
>> Subject: [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8
>>
>> This patch fixes a maybe-uninitialized warning when compiling DPDK with
>> GCC 4.8
>>
>> examples/ip_pipeline/pipeline/pipeline_common_fe.c: In function
>> 'app_pipeline_track_pktq_out_to_link':
>> examples/ip_pipeline/pipeline/pipeline_common_fe.c:66:31: error:
>> 'reader' may be used uninitialized in this function [-Werror=maybe-
>> uninitialized]
>>
>>    struct app_pktq_out_params *pktq_out =
>>
>> Fixes: 760064838ec0 ("examples/ip_pipeline: link routing output ports to
>> devices")
>>
>> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
>> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
>> ---
>>  examples/ip_pipeline/app.h | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
>> index 7611341..242dae8 100644
>> --- a/examples/ip_pipeline/app.h
>> +++ b/examples/ip_pipeline/app.h
>> @@ -667,11 +667,11 @@ app_swq_get_reader(struct app_params *app,
>>  	struct app_pktq_swq_params *swq,
>>  	uint32_t *pktq_in_id)
>>  {
>> -	struct app_pipeline_params *reader;
>> +	struct app_pipeline_params *reader = NULL;
>>  	uint32_t pos = swq - app->swq_params;
>>  	uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
>>  		RTE_DIM(app->pipeline_params));
>> -	uint32_t n_readers = 0, id, i;
>> +	uint32_t n_readers = 0, id = 0, i;
>>
>>  	for (i = 0; i < n_pipelines; i++) {
>>  		struct app_pipeline_params *p = &app->pipeline_params[i];
>> @@ -727,11 +727,11 @@ app_tm_get_reader(struct app_params *app,
>>  	struct app_pktq_tm_params *tm,
>>  	uint32_t *pktq_in_id)
>>  {
>> -	struct app_pipeline_params *reader;
>> +	struct app_pipeline_params *reader = NULL;
>>  	uint32_t pos = tm - app->tm_params;
>>  	uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
>>  		RTE_DIM(app->pipeline_params));
>> -	uint32_t n_readers = 0, id, i;
>> +	uint32_t n_readers = 0, id = 0, i;
>>
>>  	for (i = 0; i < n_pipelines; i++) {
>>  		struct app_pipeline_params *p = &app->pipeline_params[i];
>> --
>> 2.5.5
>
>
>No need for this patch, as these fixes have been already applied by Ethan's patch.
>
>Daniel, please check and let us know if otherwise.

You are correct
  
Daniel Mrzyglod June 22, 2016, 8:45 a.m. UTC | #3
>From: Mrzyglod, DanielX T
>Sent: Tuesday, June 21, 2016 11:36 AM
>To: Singh, Jasvinder <jasvinder.singh@intel.com>; Dumitrescu, Cristian
><cristian.dumitrescu@intel.com>
>Cc: dev@dpdk.org; Mrzyglod, DanielX T <danielx.t.mrzyglod@intel.com>
>Subject: [PATCH v2] examples/ip_pipeline: fix build error for gcc 4.8
>
>This patch fixes a maybe-uninitialized warning when compiling DPDK with GCC 4.8
>
>examples/ip_pipeline/pipeline/pipeline_common_fe.c: In function
>'app_pipeline_track_pktq_out_to_link':
>examples/ip_pipeline/pipeline/pipeline_common_fe.c:66:31: error:
>'reader' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
>   struct app_pktq_out_params *pktq_out =
>
>Fixes: 760064838ec0 ("examples/ip_pipeline: link routing output ports to
>devices")
>
>Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
>Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
>---
> examples/ip_pipeline/app.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
>index 7611341..242dae8 100644
>--- a/examples/ip_pipeline/app.h
>+++ b/examples/ip_pipeline/app.h
>@@ -667,11 +667,11 @@ app_swq_get_reader(struct app_params *app,
> 	struct app_pktq_swq_params *swq,
> 	uint32_t *pktq_in_id)
> {
>-	struct app_pipeline_params *reader;
>+	struct app_pipeline_params *reader = NULL;
> 	uint32_t pos = swq - app->swq_params;
> 	uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
> 		RTE_DIM(app->pipeline_params));
>-	uint32_t n_readers = 0, id, i;
>+	uint32_t n_readers = 0, id = 0, i;
>
> 	for (i = 0; i < n_pipelines; i++) {
> 		struct app_pipeline_params *p = &app->pipeline_params[i];
>@@ -727,11 +727,11 @@ app_tm_get_reader(struct app_params *app,
> 	struct app_pktq_tm_params *tm,
> 	uint32_t *pktq_in_id)
> {
>-	struct app_pipeline_params *reader;
>+	struct app_pipeline_params *reader = NULL;
> 	uint32_t pos = tm - app->tm_params;
> 	uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
> 		RTE_DIM(app->pipeline_params));
>-	uint32_t n_readers = 0, id, i;
>+	uint32_t n_readers = 0, id = 0, i;
>
> 	for (i = 0; i < n_pipelines; i++) {
> 		struct app_pipeline_params *p = &app->pipeline_params[i];
>--
>2.5.5

Self-NACK already applied
  

Patch

diff --git a/examples/ip_pipeline/app.h b/examples/ip_pipeline/app.h
index 7611341..242dae8 100644
--- a/examples/ip_pipeline/app.h
+++ b/examples/ip_pipeline/app.h
@@ -667,11 +667,11 @@  app_swq_get_reader(struct app_params *app,
 	struct app_pktq_swq_params *swq,
 	uint32_t *pktq_in_id)
 {
-	struct app_pipeline_params *reader;
+	struct app_pipeline_params *reader = NULL;
 	uint32_t pos = swq - app->swq_params;
 	uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
 		RTE_DIM(app->pipeline_params));
-	uint32_t n_readers = 0, id, i;
+	uint32_t n_readers = 0, id = 0, i;
 
 	for (i = 0; i < n_pipelines; i++) {
 		struct app_pipeline_params *p = &app->pipeline_params[i];
@@ -727,11 +727,11 @@  app_tm_get_reader(struct app_params *app,
 	struct app_pktq_tm_params *tm,
 	uint32_t *pktq_in_id)
 {
-	struct app_pipeline_params *reader;
+	struct app_pipeline_params *reader = NULL;
 	uint32_t pos = tm - app->tm_params;
 	uint32_t n_pipelines = RTE_MIN(app->n_pipelines,
 		RTE_DIM(app->pipeline_params));
-	uint32_t n_readers = 0, id, i;
+	uint32_t n_readers = 0, id = 0, i;
 
 	for (i = 0; i < n_pipelines; i++) {
 		struct app_pipeline_params *p = &app->pipeline_params[i];