[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/2] xenalyze: fix misleading indentation.



On 22/01/16 14:27, Ian Campbell wrote:
> gcc-6 adds -Wmisleading-indentation which found these issues.
> 
> xenalyze.c: In function 'weighted_percentile':
> xenalyze.c:2136:18: error: statement is indented as if it were guarded by... 
> [-Werror=misleading-indentation]
>              L=I; L_weight = I_weight;
>                   ^~~~~~~~
> 
> xenalyze.c:2135:9: note: ...this 'if' clause, but it is not
>          if(J_weight<K_weight)
>          ^~
> 
> xenalyze.c:2138:18: error: statement is indented as if it were guarded by... 
> [-Werror=misleading-indentation]
>              R=J; R_weight = J_weight;
>                   ^~~~~~~~
> 
> xenalyze.c:2137:9: note: ...this 'if' clause, but it is not
>          if(K_weight<I_weight)
>          ^~
> 
> xenalyze.c: In function 'self_weighted_percentile':
> xenalyze.c:2215:18: error: statement is indented as if it were guarded by... 
> [-Werror=misleading-indentation]
>              L=I; L_weight = I_weight;
>                   ^~~~~~~~
> 
> xenalyze.c:2214:9: note: ...this 'if' clause, but it is not
>          if(J_weight<K_weight)
>          ^~
> 
> xenalyze.c:2217:18: error: statement is indented as if it were guarded by... 
> [-Werror=misleading-indentation]
>              R=J; R_weight = J_weight;
>                   ^~~~~~~~
> 
> xenalyze.c:2216:9: note: ...this 'if' clause, but it is not
>          if(K_weight<I_weight)
>          ^~
> 
> I've modified according to what I think the intention is, i.e. added braces
> rather than moving the line in question out a level.
> 
> I have only build tested the result.
> 
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

!!!

Hrm, well obviously the "weighted percentiles" have been wonky for a
long time. :-/

Reviewed-by: George Dunlap <george.dunlap@xxxxxxxxxx>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.