Bug #7871

libm: misleading-indentation errors

Added by Toomas Soome 3 months ago. Updated 3 months ago.

Status:ClosedStart date:2017-02-15
Priority:NormalDue date:
Assignee:Toomas Soome% Done:

100%

Category:lib - userland libraries
Target version:-
Difficulty:Medium Tags:needs-triage

Description

../common/C/sincospi.c: In function 'sincospi':
../common/C/sincospi.c:158:4: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
    else
    ^~~~
../common/C/sincospi.c:167:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
     y = (n & 2) == 0 ? 0.0 : 1.0;
     ^
../common/C/sincospi.c:178:4: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
    else
    ^~~~
../common/C/sincospi.c:180:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
     if ((n & 4) != 0)
     ^~

History

#1 Updated by Marcel Telka 3 months ago

  • Description updated (diff)

#2 Updated by Gordon Ross 3 months ago

Why not just turn off "misleading indentation" errors for most of these?
(not specifically about this bug, but all the "misleading indentation" warnings in general)

#3 Updated by Toomas Soome 3 months ago

Gordon Ross wrote:

Why not just turn off "misleading indentation" errors for most of these?

Why would we even bother with all those reviews and checks? Our code really is quite bad, silencing the lint and suppressing warnings do not make it better.

#4 Updated by Electric Monk 3 months ago

  • % Done changed from 90 to 100
  • Status changed from New to Closed

git commit 709db5a3061407b4bc5fa69b7edf4c86f58ce9f6

commit  709db5a3061407b4bc5fa69b7edf4c86f58ce9f6
Author: Toomas Soome <tsoome@me.com>
Date:   2017-03-14T05:35:42.000Z

    7871 libm: misleading-indentation errors
    Reviewed by: Marcel Telka <marcel@telka.sk>
    Reviewed by: Julien Gueytat <contact@jgueytat.fr>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom