Skip to content

Commit d5f51b2

Browse files
authored
[FRR]: Fix compiler warnings (#23181)
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.
1 parent cf1c101 commit d5f51b2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/sonic-frr/dplane_fpm_sonic/dplane_fpm_sonic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
#define FPM_HEADER_SIZE 4
7676

7777
/* Default SRv6 SID format values */
78-
DEFAULT_SRV6_LOCALSID_FORMAT_BLOCK_LEN = 32;
79-
DEFAULT_SRV6_LOCALSID_FORMAT_NODE_LEN = 16;
80-
DEFAULT_SRV6_LOCALSID_FORMAT_FUNCTION_LEN = 16;
81-
DEFAULT_SRV6_LOCALSID_FORMAT_ARGUMENT_LEN = 0;
78+
#define DEFAULT_SRV6_LOCALSID_FORMAT_BLOCK_LEN 32
79+
#define DEFAULT_SRV6_LOCALSID_FORMAT_NODE_LEN 16
80+
#define DEFAULT_SRV6_LOCALSID_FORMAT_FUNCTION_LEN 16
81+
#define DEFAULT_SRV6_LOCALSID_FORMAT_ARGUMENT_LEN 0
8282

8383
/*
8484
* Time in seconds that if the other end is not responding

0 commit comments

Comments
 (0)