Browse Source
With -Wsign-compare, compilers warn about a mismatching signedness in comparisons in the function get_node_by_path(). Taking the difference between two pointers results in a signed ptrdiff_t type, which mismatches the unsigned type returned by strlen(). Since "p" has been returned by a call to strchr() with "path" as its argument, we know for sure that it's bigger than "path", so the difference must be positive. So a cast to an unsigned type is valid. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Message-Id: <20210611171040.25524-7-andre.przywara@arm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>main
Andre Przywara
4 years ago
committed by
David Gibson
1 changed files with 1 additions and 1 deletions
Loading…
Reference in new issue