Actions
Bug #8284
closedfdc: misleading-indentation
Start date:
2017-05-28
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
Description
Build error with gcc 6:
../../common/io/fdc.c: In function 'fdmotort': ../../common/io/fdc.c:2088:2: error: this 'if' clause does not guard... [-Werror=misleading-indentation] if ((fcp->c_flags & FCFLG_WAITING) && ^~ ../../common/io/fdc.c:2093:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if (newxstate == -1) { ^~ cc1: all warnings being treated as errors
Since the newxstate is initialized to 0, the checks
newxstate == -1
and
newxstate == FXS_END
only make sense after
newxstate = fdc_statemach(fcp);
and therefore both if () statements do belong to the same logical code block where we actually do change the value of the newxstate.
Updated by Electric Monk over 6 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 1518b816b22db27acb81c63823981b340d1534ce
commit 1518b816b22db27acb81c63823981b340d1534ce Author: Toomas Soome <tsoome@me.com> Date: 2017-06-05T14:01:55.000Z 8284 fdc: misleading-indentation Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Actions