Project

General

Profile

Actions

Bug #8329

closed

ldapcachemgr: misleading-indentation

Added by Toomas Soome about 5 years ago. Updated about 5 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors from gcc 6:

cachemgr.c: In function 'main':
cachemgr.c:471:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
   if (strlen(current_admin.logfile) == 0)
   ^~
cachemgr.c:473:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
    (void) cachemgr_set_lf(&current_admin,
    ^
cc1: all warnings being treated as errors

The current_admin is global structure with logfile defined as fixed length string, so the current_ admin is initially zeroed out; this else block is setting the log file and just before calling the cachemgr_set_lf() to set log file, the code is making sure the current_admin.logfile has the actual file name.

The /dev/null is set for log file only in case the ldapcachemgr was not started with -l, meaning the else block was meant to set log file, either to one specified with -l or /dev/null.

Actions #1

Updated by Toomas Soome about 5 years ago

  • Description updated (diff)
Actions #2

Updated by Electric Monk about 5 years ago

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

git commit eb28af623974cfc31cb4545d2965bbaca3fb6888

commit  eb28af623974cfc31cb4545d2965bbaca3fb6888
Author: Toomas Soome <tsoome@me.com>
Date:   2017-06-19T17:08:40.000Z

    8329 ldapcachemgr: misleading-indentation
    8364 ldapcachemgr does not set log file in debug mode if -l was not used
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Yuri Pankov <yuripv@gmx.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF