Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix minimal-mdns examples with clang (project-chip#6082)
This fixes some warnings when building with clang: clang++ -MMD -MF obj/mdns-advertiser.advertiser.cpp.o.d -Wconversion -O0 -g2 -fno-common -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -Wall -Wextra -Wshadow -Wunreachable-code -Werror -Wimplicit-fallthrough -Wheader-hygiene -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-missing-field-initializers -Wno-unused-parameter -fdiagnostics-color -fno-strict-aliasing -D_REENTRANT -isystem../../third_party/connectedhomeip/third_party/ot-br-posix/repo/src -isystem../../third_party/connectedhomeip/third_party/ot-br-posix/repo/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=gnu++14 -fno-rtti -Wnon-virtual-dtor -DCHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK=1 -DCHIP_HAVE_CONFIG_H=1 -DLWIP_IPV4=1 -DLWIP_IPV6=1 -DLWIP_API=1 -DLWIP_ETHERNET=1 -DLWIP_SLIP=0 -DLWIP_6LOWPAN=1 -DLWIP_PPP=1 -I../../third_party/connectedhomeip/src/app/util -I../../third_party/connectedhomeip/src/app -Igen/third_party/connectedhomeip/src/app/include -I../../third_party/connectedhomeip/src/include -I../../third_party/connectedhomeip/src -Igen/include -I../../third_party/connectedhomeip/src/lib -I../../third_party/connectedhomeip/config/standalone -I../../third_party/connectedhomeip/third_party/nlassert/repo/include -I../../third_party/connectedhomeip/third_party/nlio/repo/include -I../../third_party/connectedhomeip/src/lwip/standalone -I../../third_party/connectedhomeip/third_party/lwip/repo/lwip/src/include -I../../third_party/connectedhomeip/src/lwip/include -I../../third_party/connectedhomeip/src/setup_payload -Igen -Igen -I../../third_party/connectedhomeip/third_party/inipp/repo/inipp -I../../third_party/connectedhomeip/src/app/server -c ../../advertiser.cpp -o obj/mdns-advertiser.advertiser.cpp.o This fixes the following warnings: ../../advertiser.cpp:123:29: error: implicit conversion changes signedness: 'long long' to 'uint64_t' (aka 'unsigned long') [-Werror,-Wsign-conversion] gOptions.fabricId = atoll(aValue); ~ ^~~~~~~~~~~~~ clang++ -MMD -MF obj/minimal-mdns-server.server.cpp.o.d -Wconversion -O0 -g2 -fno-common -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -Wall -Wextra -Wshadow -Wunreachable-code -Werror -Wimplicit-fallthrough -Wheader-hygiene -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-missing-field-initializers -Wno-unused-parameter -fdiagnostics-color -fno-strict-aliasing -D_REENTRANT -isystem../../third_party/connectedhomeip/third_party/ot-br-posix/repo/src -isystem../../third_party/connectedhomeip/third_party/ot-br-posix/repo/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -std=gnu++14 -fno-rtti -Wnon-virtual-dtor -DCHIP_CONFIG_IM_ENABLE_SCHEMA_CHECK=1 -DCHIP_HAVE_CONFIG_H=1 -DLWIP_IPV4=1 -DLWIP_IPV6=1 -DLWIP_API=1 -DLWIP_ETHERNET=1 -DLWIP_SLIP=0 -DLWIP_6LOWPAN=1 -DLWIP_PPP=1 -I../../third_party/connectedhomeip/src/app/util -I../../third_party/connectedhomeip/src/app -Igen/third_party/connectedhomeip/src/app/include -I../../third_party/connectedhomeip/src/include -I../../third_party/connectedhomeip/src -Igen/include -I../../third_party/connectedhomeip/src/lib -I../../third_party/connectedhomeip/config/standalone -I../../third_party/connectedhomeip/third_party/nlassert/repo/include -I../../third_party/connectedhomeip/third_party/nlio/repo/include -I../../third_party/connectedhomeip/src/lwip/standalone -I../../third_party/connectedhomeip/third_party/lwip/repo/lwip/src/include -I../../third_party/connectedhomeip/src/lwip/include -I../../third_party/connectedhomeip/src/setup_payload -Igen -Igen -I../../third_party/connectedhomeip/third_party/inipp/repo/inipp -I../../third_party/connectedhomeip/src/app/server -c ../../server.cpp -o obj/minimal-mdns-server.server.cpp.o ../../server.cpp:89:5: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] nullptr, ^~~~~~~ { } Tested by: gn gen out/host_clang --args=is_clang=true ninja -C out/host_clang
- Loading branch information