-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi,
For static analysis, we turn on a bunch of warnings and features to detect programming bugs in C/C++ code in the Ubuntu toolchain. When building tsn-utils, I received a non-trivial number of warnings (reproduced below).
These typically indicate potentially serious programming issues e.g. buffer overflows, but I didn't get the chance to review them yet.
Best,
LM
make -C tsn-apps/br_prog all
make[2]: Entering directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/br_prog'
cc -g -O2 -ffile-prefix-map=/home/ubuntu/tsn-utils/ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c -o br_prog.o br_prog.c
br_prog.c: In function ‘pmac_merge_stats’:
br_prog.c:139:51: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
139 | printf("TX MAC Merge Hold Count\t\t\t: %llu\n", st->tx_hold_cnt);
| ~~~^ ~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:140:53: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
140 | printf("TX MAC Merge Fragment Count\t\t: %llu\n", st->tx_frag_cnt);
| ~~~^ ~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:141:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
141 | printf("RX MAC Merge Assembly OK Count\t\t: %llu\n", st->rx_assembly_ok_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:142:57: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
142 | printf("RX MAC Merge Assembly Error Count\t: %llu\n", st->rx_assembly_err_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:143:54: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
143 | printf("RX MAC Merge SMD Error Count\t\t: %llu\n", st->rx_smd_err_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:144:53: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
144 | printf("RX MAC Merge Fragment Count\t\t: %llu\n", st->rx_frag_cnt);
| ~~~^ ~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c: In function ‘preemp_stats’:
br_prog.c:150:44: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
150 | printf("Rx Bytes Counter\t\t\t: %llu\n", st->rx_bytes_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:151:44: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
151 | printf("Tx Bytes Counter\t\t\t: %llu\n", st->tx_bytes_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:152:50: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
152 | printf("Undersize Frames Counter\t\t: %llu\n", st->undersize_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:153:51: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
153 | printf("Fragment Frames Counter\t\t\t: %llu\n", st->frag_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:154:51: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
154 | printf("Rx 64-Byte Frames Counter\t\t: %llu\n", st->rx_64_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:155:55: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
155 | printf("Rx 65-127-Byte Frames Counter\t\t: %llu\n", st->rx_65_127_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:156:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
156 | printf("Rx 128-255-Byte Frames Counter\t\t: %llu\n", st->rx_128_255_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:157:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
157 | printf("Rx 256-511-Byte Frames Counter\t\t: %llu\n", st->rx_256_511_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:158:57: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
158 | printf("Rx 512-1023-Byte Frames Counter\t\t: %llu\n", st->rx_512_1023_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:159:52: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
159 | printf("Rx 1024-Max Frames Counter\t\t: %llu\n", st->rx_1024_max_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:160:52: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
160 | printf("Rx Oversize Frames Counter\t\t: %llu\n", st->rx_oversize_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:161:51: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
161 | printf("Tx 64-Byte Frames Counter\t\t: %llu\n", st->tx_64_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:162:55: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
162 | printf("Tx 65-127-Byte Frames Counter\t\t: %llu\n", st->tx_65_127_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:163:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
163 | printf("Tx 128-255-Byte Frames Counter\t\t: %llu\n", st->tx_128_255_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:164:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
164 | printf("Tx 256-511-Byte Frames Counter\t\t: %llu\n", st->tx_256_511_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:165:57: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
165 | printf("Tx 512-1023-Byte Frames Counter\t\t: %llu\n", st->tx_512_1023_bytes_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:166:52: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
166 | printf("Tx 1024-Max Frames Counter\t\t: %llu\n", st->tx_1024_max_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:167:52: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
167 | printf("Tx Oversize Frames Counter\t\t: %llu\n", st->tx_oversize_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:168:50: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
168 | printf("Rx Good Frames Counter\t\t\t: %llu\n", st->rx_good_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:169:48: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
169 | printf("Rx FCS Error Counter\t\t\t: %llu\n", st->rx_fcs_err_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:170:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
170 | printf("Rx Good Broadcast Frames Counter\t: %llu\n", st->rx_good_broadcast_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:171:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
171 | printf("Rx Good Multicast Frames Counter\t: %llu\n", st->rx_good_multicast_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:172:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
172 | printf("Rx Good Control Frames Counter\t\t: %llu\n", st->rx_good_control_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:173:55: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
173 | printf("Rx OUT OF Range Error Counter\t\t: %llu\n", st->rx_out_of_range_err_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:174:53: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
174 | printf("Rx Good VLAN Frames Counter\t\t: %llu\n", st->rx_good_vlan_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:175:54: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
175 | printf("Rx Good Pause Frames Counter\t\t: %llu\n", st->rx_good_pause_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:176:53: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
176 | printf("Rx Bad Opcode Frame Counter\t\t: %llu\n", st->rx_bad_opcode_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:177:50: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
177 | printf("Tx Good Frames Counter\t\t\t: %llu\n", st->tx_good_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:178:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
178 | printf("Tx Good Broadcast Frames Counter\t: %llu\n", st->tx_good_broadcast_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:179:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
179 | printf("Tx Good Multicast Frames Counter\t: %llu\n", st->tx_good_multicast_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:180:51: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
180 | printf("Tx Underrun Error Counter\t\t: %llu\n", st->tx_underrun_err_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:181:56: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
181 | printf("Tx Good Control Frames Counter\t\t: %llu\n", st->tx_good_control_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:182:53: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
182 | printf("Tx Good VLAN Frames Counter\t\t: %llu\n", st->tx_good_vlan_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c:183:54: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘counter’ {aka ‘union static_cntr’} [-Wformat=]
183 | printf("Tx Good Pause Frames Counter\t\t: %llu\n", st->tx_good_pause_frames_cnt);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | counter {aka union static_cntr}
| long long unsigned int
br_prog.c: In function ‘main’:
br_prog.c:357:9: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
357 | close(fd);
| ^~~~~
| pclose
[...]
make[2]: Entering directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/pcp_prog'
cc -g -O2 -ffile-prefix-map=/home/ubuntu/tsn-utils/ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c -o pcp_prog.o pcp_prog.c
pcp_prog.c: In function ‘set_pcp’:
pcp_prog.c:105:20: warning: assignment to ‘FILE *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
105 | fd = open("/dev/switch", O_RDWR); /* Driver open */
| ^
pcp_prog.c:106:24: warning: comparison between pointer and integer
106 | if (fd == -1) {
| ^~
pcp_prog.c:110:31: warning: passing argument 1 of ‘ioctl’ makes integer from pointer without a cast [-Wint-conversion]
110 | if (0 > ioctl(fd, SET_PMAP_CONFIG, &pri_info)) {
| ^~
| |
| FILE *
In file included from pcp_prog.c:8:
/usr/include/aarch64-linux-gnu/sys/ioctl.h:42:23: note: expected ‘int’ but argument is of type ‘FILE *’
42 | extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
| ~~~~^~~~
pcp_prog.c:53:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
53 | fgets(st_temp,30,fp_cfg);
| ^~~~~~~~~~~~~~~~~~~~~~~~
pcp_prog.c:70:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
70 | fgets(res_temp,30,fp_cfg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
pcp_prog.c: In function ‘get_pcp’:
pcp_prog.c:132:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
132 | fgets(st_str,20,fp);
| ^~~~~~~~~~~~~~~~~~~
pcp_prog.c:139:9: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
139 | fgets(res_str,20,fp);
| ^~~~~~~~~~~~~~~~~~~~
cc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o pcp_prog pcp_prog.o
[...]
make[2]: Entering directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/ptptime'
cc -g -O2 -ffile-prefix-map=/home/ubuntu/tsn-utils/ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c -o ptptime.o ptptime.c
ptptime.c: In function ‘main’:
ptptime.c:40:17: warning: implicit declaration of function ‘clock_gettime’; did you mean ‘SYS_clock_gettime’? [-Wimplicit-function-declaration]
40 | clock_gettime(clkid, &tmx);
| ^~~~~~~~~~~~~
| SYS_clock_gettime
ptptime.c:44:17: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
44 | usleep(100000);
| ^~~~~~
cc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o ptptime ptptime.o
[...]
make[2]: Entering directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/qbv_sched'
cc -g -O2 -ffile-prefix-map=/home/ubuntu/tsn-utils/ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c -o qbv_sched.o qbv_sched.c
qbv_sched.c: In function ‘set_schedule’:
qbv_sched.c:110:17: warning: implicit declaration of function ‘clock_gettime’; did you mean ‘SYS_clock_gettime’? [-Wimplicit-function-declaration]
110 | clock_gettime(clkid, &tmx);
| ^~~~~~~~~~~~~
| SYS_clock_gettime
cc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o qbv_sched qbv_sched.o -lconfig
[...]
make[2]: Entering directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/qci_prog'
cc -g -O2 -ffile-prefix-map=/home/ubuntu/tsn-utils/ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c -o qci_prog.o qci_prog.c
qci_prog.c: In function ‘main’:
qci_prog.c:570:33: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=]
570 | printf("CIR : %lu\n", data.meter_conf_data.cir);
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long unsigned int unsigned int
| %u
qci_prog.c:571:33: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=]
571 | printf("EIR : %lu\n", data.meter_conf_data.eir);
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long unsigned int unsigned int
| %u
qci_prog.c:572:33: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=]
572 | printf("CBR : %lu\n", data.meter_conf_data.cbr);
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long unsigned int unsigned int
| %u
qci_prog.c:573:33: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=]
573 | printf("EBR : %lu\n", data.meter_conf_data.ebr);
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long unsigned int unsigned int
| %u
qci_prog.c:574:34: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat=]
574 | printf("Mode : %lu\n", data.meter_conf_data.mode);
| ~~^ ~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long unsigned int int
| %u
cc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o qci_prog qci_prog.o
make[2]: Leaving directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/qci_prog'
[...]
cc -g -O2 -ffile-prefix-map=/home/ubuntu/tsn-utils/ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c -o switch_cam.o switch_cam.c
switch_cam.c: In function ‘main’:
switch_cam.c:759:34: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘unsigned char *’ [-Wformat=]
759 | sscanf(optarg, "%d", &ipv);
| ~^ ~~~~
| | |
| | unsigned char *
| int *
| %hhd
switch_cam.c:882:35: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘unsigned char *’ [-Wformat=]
882 | sscanf(argv[8], "%d", &ipv);
| ~^ ~~~~
| | |
| | unsigned char *
| int *
| %hhd
cc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o switch_cam switch_cam.o
make[2]: Leaving directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/switch_cam'
[...]
make[2]: Entering directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/switch_cam2'
cc -g -O2 -ffile-prefix-map=/home/ubuntu/tsn-utils/ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c -o switch_cam2.o switch_cam2.c
switch_cam2.c: In function ‘main’:
switch_cam2.c:397:34: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘unsigned char *’ [-Wformat=]
397 | sscanf(optarg, "%d", &ipv);
| ~^ ~~~~
| | |
| | unsigned char *
| int *
| %hhd
cc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o switch_cam2 switch_cam2.o
[...]
make[2]: Entering directory '/home/ubuntu/tsn-utils/ubuntu/tsn-apps/tadma_prog'
cc -g -O2 -ffile-prefix-map=/home/ubuntu/tsn-utils/ubuntu=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c -o tadma_prog.o tadma_prog.c
tadma_prog.c: In function ‘main’:
tadma_prog.c:172:17: warning: ‘return’ with no value, in function returning non-void
172 | return;
| ^~~~~~
tadma_prog.c:147:5: note: declared here
147 | int main(int argc, char **argv)
| ^~~~
cc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o tadma_prog tadma_prog.o -lconfig
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels