Commit 773238b
authored
[build]: Fix format string for size_t (mudsut4ke#1576)
We met below error message in armhf build (32-bit)
```
g++ -DHAVE_CONFIG_H -I. -I.. -I ../lib -I .. -I ../warmrestart -I flex_counter -I debug_counter -g -DNDEBUG -std=c++14 -Wall -fPIC -Wno-write-strings -I/usr/include/libnl3 -I/usr/include/swss -Werror -Wno-reorder -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wextra -Wfloat-equal -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimport -Winit-self -Winvalid-pch -Wlong-long -Wmissing-field-initializers -Wmissing-format-attribute -Wno-aggregate-return -Wno-padded -Wno-switch-enum -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wstack-protector -Wstrict-aliasing=3 -Wswitch -Wswitch-default -Wunreachable-code -Wunused -Wvariadic-macros -Wno-switch-default -Wno-long-long -Wno-redundant-decls -I /usr/include/sai -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/__w/1/s=. -fstack-protector-strong -Wformat -Werror=format-security -c -o orchagent-copporch.o `test -f 'copporch.cpp' || echo './'`copporch.cpp
In file included from /usr/include/swss/redistran.h:7,
from /usr/include/swss/table.h:17,
from orch.h:17,
from fgnhgorch.h:4,
from fgnhgorch.cpp:3:
fgnhgorch.cpp: In member function 'virtual bool FgNhgOrch::bake()':
/usr/include/swss/logger.h:17:101: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'unsigned int'} [-Werror=format=]
#define SWSS_LOG_NOTICE(MSG, ...) swss::Logger::getInstance().write(swss::Logger::SWSS_NOTICE, ":- %s: " MSG, __FUNCTION__, ##__VA_ARGS__)
fgnhgorch.cpp:117:5: note: in expansion of macro 'SWSS_LOG_NOTICE'
SWSS_LOG_NOTICE("Warm reboot: recovering entry %lu from state", keys.size());
^~~~~~~~~~~~~~~
In file included from /usr/include/c++/8/vector:69,
from acltable.h:10,
from portsorch.h:6,
from portsorch.cpp:1:
```1 parent 7ba4e43 commit 773238b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
0 commit comments