multipath-tools: fix an assignment ambiguity
PATCH 1/1 multipath-tools: fix an assignment ambiguity
spotted by indent:./kpartx/gpt.c:623: Warning:old style assignment ambiguity in "=-". Assuming "= -"
Cc Martin Wilck <[email protected]>
Cc Benjamin Marzinski <[email protected]>
Cc Christophe Varoqui <[email protected]>
Cc DM-DEVEL ML <[email protected]>
Signed-off-by Xose Vazquez Perez <[email protected]>
--- kpartx/gpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kpartx/gpt.c +1 -1
@@ -606,7 +606,7 @@ read_gpt_pt (int fd, __attribute__((unused)) struct slice all,gpt_entry *ptes =NULL ;unsigned int i;int n =0 ; -int last_used_index=-1 ; +int last_used_index =-1 ;int sector_size_mul =get_sector_size (fd)/512 ;if (!find_valid_gpt (fd, &gpt, &ptes) || !gpt || !ptes) {
Signature · 1 line
2.43.0
Quoted 4 lines · Xose Vazquez Perez
spotted by indent:
./kpartx/gpt.c:623: Warning:old style assignment ambiguity in "=-". Assuming "= -"
Quoted 8 lines
Cc Martin Wilck <[email protected]>Cc Benjamin Marzinski <[email protected]>Cc Christophe Varoqui <[email protected]>Cc DM-DEVEL ML <[email protected]>Signed-off-by Xose Vazquez Perez <[email protected]>---
kpartx/gpt.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
This "ambiguity" must relate to some ancient compilers accepting '=-' as an alias for '-='. That must predate K&R 1st edition (1978), which clearly defines the assignment operator syntax for operator 'op' as 'op=' [1].
But well, it's always good to eliminate warnings, so
Reviewed-by Martin Wilck <[email protected]>
[1] https://www.academia.edu/34487452/First_edition_of_c_by_dennis_ritche