Declarations of variables must be placed before the executable lines of
a block, by convention. Use 'must' instead of 'may' here and clarify wording.
Details
- Reviewers
pstef rpokala • hselasky - Group Reviewers
manpages - Commits
- rGe2fa10e67646: style: Tighten up one use of 'may'
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
share/man/man9/style.9 | ||
---|---|---|
703–704 | I think the "may" refers to the "at the start of any block". i.e. what is intended is "Declarations must be placed before executable lines, and may occur at the start of any block." |
share/man/man9/style.9 | ||
---|---|---|
703–704 | I think this is a good suggestion. |
share/man/man9/style.9 | ||
---|---|---|
703–704 | I like pstef's suggestion. |
share/man/man9/style.9 | ||
---|---|---|
538 | We have only 307 NOTREACHEDs in the tree, in 121 files. annotations (like __dead2 or __assert_unreachable as some folks mentioned on IRC) are much better |
__assert_unreachable is the more modern spelling of /* NOTREACHED */ so
recommend that. Use statement (the language the C standard uses) rather than the
more vague executable lines.
share/man/man9/style.9 | ||
---|---|---|
538 | Code which is unreachable for non-obvious reasons should be marked accordingly. In the kernel, .Fn __assert_unreachable should be used in preference to the older /* .Li NOTREACHED */. That annotation is not available in userland, so use /* .Li NOTREACHED */ there instead. |
share/man/man9/style.9 | ||
---|---|---|
538 | I'd rather just expose __assert_unreachable in userland. I don't read the previous version as encouraging the use of annotations, just permitting them. The new version reads to me as if it more strongly mandates it. That is, I feel like the old use of may here was actually correct. |
share/man/man9/style.9 | ||
---|---|---|
538 | I think I'll drop these chunks of the change as 'premature' then. We'll revisit once we have different interfaces and want a stronger encouragement. |
So that's a 'no' on expanding the scope of this review to have full RFC-language. I may do that in the future, but I don't
have time for it now.