Project

General

Profile

Actions

Bug #14337

closed

tail: this 'if' clause does not guard...

Added by Toomas Soome 8 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Build error with gcc 11:

    tail.c:89:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
       89 |                 if (off)                                                \
          |                 ^~
    tail.c:111:25: note: in expansion of macro 'ARG'
      111 |                         ARG(512, FBYTES, RBYTES);
          |                         ^~~
    tail.c:91:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
       91 |                         style = (forward);                              \
          |                         ^~~~~
    tail.c:111:25: note: in expansion of macro 'ARG'
      111 |                         ARG(512, FBYTES, RBYTES);
          |                         ^~~
    tail.c:89:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
       89 |                 if (off)                                                \
          |                 ^~
    tail.c:114:25: note: in expansion of macro 'ARG'
      114 |                         ARG(1, FBYTES, RBYTES);
          |                         ^~~
    tail.c:91:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
       91 |                         style = (forward);                              \
          |                         ^~~~~
    tail.c:114:25: note: in expansion of macro 'ARG'
      114 |                         ARG(1, FBYTES, RBYTES);
          |                         ^~~
    tail.c:89:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
       89 |                 if (off)                                                \
          |                 ^~
    tail.c:120:25: note: in expansion of macro 'ARG'
      120 |                         ARG(1, FLINES, RLINES);
          |                         ^~~
    tail.c:91:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
       91 |                         style = (forward);                              \
          |                         ^~~~~
    tail.c:120:25: note: in expansion of macro 'ARG'
      120 |                         ARG(1, FLINES, RLINES);
          |                         ^~~
    cc1: all warnings being treated as errors

The argument with ncb options can have prefix '+' or '', denoting if the starting location should be relative to beginning of the file (), or end of the file (-, default), therefore the case '' should always set style = (forward);

Actions #1

Updated by Electric Monk 8 months ago

  • Gerrit CR set to 1893
Actions #2

Updated by Toomas Soome 8 months ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk 7 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 339cc970f8a66bc88984fa70fdb4cbf93a9315ec

commit  339cc970f8a66bc88984fa70fdb4cbf93a9315ec
Author: Toomas Soome <tsoome@me.com>
Date:   2022-01-07T19:34:06.000Z

    14337 tail: this 'if' clause does not guard...
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF