mirror of
https://github.com/espressif/openthread.git
synced 2026-10-20 22:48:17 +00:00
[core] fix implicit integer conversion warnings (#11709)
This commit enables the `-Wimplicit-int-conversion` compiler flag for `ftd`, `mtd`, and `radio` to improve code quality by detecting potential data loss from implicit type conversions. This is enabled when clang toolchain is used. All resulting warnings have been addressed by either: - Changing variable, parameter, or return types to ensure consistency and prevent overflows. - Adding explicit `static_cast` where the type conversion is intended and safe.
This commit is contained in:
@@ -619,7 +619,7 @@ void LogRouterAdvert(const Icmp6Packet &aPacket)
|
||||
|
||||
VerifyOrQuit(rdnss.IsValid());
|
||||
|
||||
for (uint8_t index = 0; index < rdnss.GetNumAddresses(); index++)
|
||||
for (uint16_t index = 0; index < rdnss.GetNumAddresses(); index++)
|
||||
{
|
||||
Log(" RDNSS - %s, lifetime:%u", rdnss.GetAddressAt(index).ToString().AsCString(),
|
||||
rdnss.GetLifetime());
|
||||
|
||||
Reference in New Issue
Block a user