8195 calendar: misleading-indentation

Review Request #490 — Created May 10, 2017 and discarded

tsoome
illumos-gate
8195
general
calprog.c:252:4: error: this 'else' clause does not guard... [-Werror=misleading-indentation]
    else
    ^~~~
calprog.c:254:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else'
     if (*(tb - 1) == '0')
     ^~
cc1: all warnings being treated as errors


  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
marcel
  1. 
      
  2. usr/src/cmd/calendar/calprog.c (Diff revision 1)
     
     

    Please add braces to the else arm too. The style guide says this:

    In either case, if one arm of an if-else statement contains braces, all arms should contain braces.

  3. 
      
tsoome
marcel
  1. Ship It!
  2. usr/src/cmd/calendar/calprog.c (Diff revision 2)
     
     

    Why this change?

    1. to remove red..

    2. Ah, okay :-). But ... maybe it would be better to replace the space-space-tab sequence by space-space-space to do not change the look and feel of the line...

  3. 
      
tsoome
marcel
  1. Ship It!
  2. 
      
gwr
  1. Ship It!
  2. 
      
aeon
  1. 
      
  2. usr/src/cmd/calendar/calprog.c (Diff revisions 2 - 3)
     
     

    Clearly not affected by the misleading-indentation warning so Ship It.
    However, perhaps align with Copyright line above.
    Superfluous spaces after inside comment. (Wondering why it was changed. Still irrelevant.)

  3. usr/src/cmd/calendar/calprog.c (Diff revisions 2 - 3)
     
     

    Superfluous space before and after inside comment.

    1. Actually this one is waiting for calendar removal (RTI posted by ptribble). So I hope I'll be able to drop it;)

  4. 
      
tsoome
Review request changed

Status: Discarded

Loading...