[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:
Abtin Keshavarzian
2025-07-14 13:06:27 -07:00
committed by GitHub
parent 02e73a0586
commit 26f23ad635
22 changed files with 51 additions and 33 deletions
+1 -1
View File
@@ -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());