Skip to content

[action] [PR:22909] [FRR]: Fix compiler warnings#23181

Merged
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/22909
Jul 2, 2025
Merged

[action] [PR:22909] [FRR]: Fix compiler warnings#23181
mssonicbld merged 1 commit intosonic-net:202505from
mssonicbld:cherry/202505/22909

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

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.
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: #22909

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit d5f51b2 into sonic-net:202505 Jul 2, 2025
20 checks passed
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.

1 participant