Skip to content

[FRR]: Fix compiler warnings#22909

Merged
yejianquan merged 2 commits intosonic-net:masterfrom
cscarpitta:fix/fix_frr_build_warnings
Jul 1, 2025
Merged

[FRR]: Fix compiler warnings#22909
yejianquan merged 2 commits intosonic-net:masterfrom
cscarpitta:fix/fix_frr_build_warnings

Conversation

@cscarpitta
Copy link
Copy Markdown
Contributor

When compiling FRR, the compiler raises the following warnings:

../zebra/dplane_fpm_sonic.c:73:1: warning: data definition has no type or storage class
   73 | DEFAULT_SRV6_LOCALSID_FORMAT_BLOCK_LEN = 32;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zebra/dplane_fpm_sonic.c:73:1: warning: type defaults to 'int' in declaration of 'DEFAULT_SRV6_LOCALSID_FORMAT_BLOCK_LEN' [-Wimplicit-int] ../zebra/dplane_fpm_sonic.c:74:1: warning: data definition has no type or storage class
   74 | DEFAULT_SRV6_LOCALSID_FORMAT_NODE_LEN = 16;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zebra/dplane_fpm_sonic.c:74:1: warning: type defaults to 'int' in declaration of 'DEFAULT_SRV6_LOCALSID_FORMAT_NODE_LEN' [-Wimplicit-int] ../zebra/dplane_fpm_sonic.c:75:1: warning: data definition has no type or storage class
   75 | DEFAULT_SRV6_LOCALSID_FORMAT_FUNCTION_LEN = 16;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zebra/dplane_fpm_sonic.c:75:1: warning: type defaults to 'int' in declaration of 'DEFAULT_SRV6_LOCALSID_FORMAT_FUNCTION_LEN' [-Wimplicit-int] ../zebra/dplane_fpm_sonic.c:76:1: warning: data definition has no type or storage class
   76 | DEFAULT_SRV6_LOCALSID_FORMAT_ARGUMENT_LEN = 0;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zebra/dplane_fpm_sonic.c:76:1: warning: type defaults to 'int' in declaration of 'DEFAULT_SRV6_LOCALSID_FORMAT_ARGUMENT_LEN' [-Wimplicit-int]

The problem is that some variables have been defined without specifying their type.

This commit fixes the warnings by defining those variables as macros.

When compiling FRR, the compiler raises the following warnings:

../zebra/dplane_fpm_sonic.c:73:1: warning: data definition has no type or storage class
   73 | DEFAULT_SRV6_LOCALSID_FORMAT_BLOCK_LEN = 32;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zebra/dplane_fpm_sonic.c:73:1: warning: type defaults to 'int' in declaration of 'DEFAULT_SRV6_LOCALSID_FORMAT_BLOCK_LEN' [-Wimplicit-int]
../zebra/dplane_fpm_sonic.c:74:1: warning: data definition has no type or storage class
   74 | DEFAULT_SRV6_LOCALSID_FORMAT_NODE_LEN = 16;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zebra/dplane_fpm_sonic.c:74:1: warning: type defaults to 'int' in declaration of 'DEFAULT_SRV6_LOCALSID_FORMAT_NODE_LEN' [-Wimplicit-int]
../zebra/dplane_fpm_sonic.c:75:1: warning: data definition has no type or storage class
   75 | DEFAULT_SRV6_LOCALSID_FORMAT_FUNCTION_LEN = 16;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zebra/dplane_fpm_sonic.c:75:1: warning: type defaults to 'int' in declaration of 'DEFAULT_SRV6_LOCALSID_FORMAT_FUNCTION_LEN' [-Wimplicit-int]
../zebra/dplane_fpm_sonic.c:76:1: warning: data definition has no type or storage class
   76 | DEFAULT_SRV6_LOCALSID_FORMAT_ARGUMENT_LEN = 0;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../zebra/dplane_fpm_sonic.c:76:1: warning: type defaults to 'int' in declaration of 'DEFAULT_SRV6_LOCALSID_FORMAT_ARGUMENT_LEN' [-Wimplicit-int]

The problem is that some variables have been defined without specifying their type.

This commit fixes the warnings by defining those variables as macros.

Signed-off-by: Carmine Scarpitta <[email protected]>
@cscarpitta cscarpitta requested a review from lguohan as a code owner June 10, 2025 07:08
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@cscarpitta
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@cscarpitta
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@cscarpitta
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@cscarpitta
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@cscarpitta
Copy link
Copy Markdown
Contributor Author

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 22909 in repo sonic-net/sonic-buildimage

@cscarpitta
Copy link
Copy Markdown
Contributor Author

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 22909 in repo sonic-net/sonic-buildimage

@cscarpitta
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

@BYGX-wcr BYGX-wcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yejianquan yejianquan merged commit 8962b85 into sonic-net:master Jul 1, 2025
20 checks passed
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202505: #23181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants