Page MenuHomeFreeBSD

Remove K&R stuff: never use it in new code.
ClosedPublic

Authored by imp on Jan 25 2018, 3:45 PM.

Details

Summary

Remove how to format K&R stuff. The project hasn't been using it in
new code for a long time.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

imp created this revision.Jan 25 2018, 3:45 PM
rpokala accepted this revision.Jan 25 2018, 3:56 PM
This revision is now accepted and ready to land.Jan 25 2018, 3:56 PM
ian accepted this revision.Jan 25 2018, 3:58 PM
jonathan accepted this revision.Jan 25 2018, 4:13 PM
jhibbits accepted this revision.Jan 25 2018, 4:15 PM
mjoras accepted this revision.Jan 25 2018, 4:34 PM

Only question I have before we remove this, is the tree void of code in this format?

If it is not then I think it would be unwise to remove this,if it is then yes, absolutely, remove this.

Only question I have before we remove this, is the tree void of code in this format?
If it is not then I think it would be unwise to remove this,if it is then yes, absolutely, remove this.

There's plenty of stuff in the tree that doesn't conform to style(9). I don't we should make compliance a prerequisite to changing bits of style(9).

dab accepted this revision.Jan 25 2018, 4:53 PM
dab added a reviewer: dab.
imp added a comment.Jan 25 2018, 4:54 PM

Only question I have before we remove this, is the tree void of code in this format?
If it is not then I think it would be unwise to remove this,if it is then yes, absolutely, remove this.

No new code has it.
There's odd corners of the tree that may still have it, but anybody changing it would remove the K&R style and go with full ANSI, so I'm not sure I understand how it would be useful to retain.

cem accepted this revision.Jan 25 2018, 5:05 PM
pfg accepted this revision.Jan 25 2018, 5:07 PM
brooks accepted this revision.Jan 25 2018, 5:18 PM
brooks added a subscriber: brooks.

Yes please.

All K&R function declarations are style bugs. Due to incomplete compiler support for function signature checking of K&R definitions, they can easily mask real bugs (but probably don't very much in our tree).

In D14051#295081, @imp wrote:

Only question I have before we remove this, is the tree void of code in this format?
If it is not then I think it would be unwise to remove this,if it is then yes, absolutely, remove this.

No new code has it.
There's odd corners of the tree that may still have it, but anybody changing it would remove the K&R style and go with full ANSI, so I'm not sure I understand how it would be useful to retain.

As in any documentation it would be useful to retain as it documents the state of things. Though the style guide is mostly thought of as how one should write code, it is also one of how the code was written and is of use to someone reading the code to understand why somethings are in the form that they are. Committers should not be considered the only consumer of style.9.

cem added a comment.Jan 25 2018, 5:24 PM

As in any documentation it would be useful to retain as it documents the state of things. Though the style guide is mostly thought of as how one should write code, it is also one of how the code was written and is of use to someone reading the code to understand why somethings are in the form that they are.

No. That is not what style(9) is for. It's a prescriptive style document.

kp accepted this revision.Jan 26 2018, 12:00 AM
bapt accepted this revision.Jan 26 2018, 8:34 AM
emaste accepted this revision.Jan 28 2018, 12:43 PM
gad accepted this revision.Jan 29 2018, 9:28 PM
gad added a subscriber: gad.

(sorry for the late noise. For some odd reason, today is the first day I've been able to connect to this page, although I've tried since last Thursday. I suspect there was a problem in the browser on my machine).

This revision was automatically updated to reflect the committed changes.