Page MenuHomeFreeBSD

Add info about c99 designationed initializers.
ClosedPublic

Authored by imp on Jan 18 2018, 9:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 10, 1:21 PM
Unknown Object (File)
Sun, Apr 7, 9:41 AM
Unknown Object (File)
Mar 7 2024, 8:42 PM
Unknown Object (File)
Mar 3 2024, 8:03 PM
Unknown Object (File)
Dec 20 2023, 2:29 AM
Unknown Object (File)
Nov 13 2023, 3:36 PM
Unknown Object (File)
Nov 11 2023, 12:38 PM
Unknown Object (File)
Nov 9 2023, 2:52 AM
Subscribers

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14471
Build 14615: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jan 18 2018, 9:29 PM

Is there a need to describe how these should be formatted? Can we place multiple initializers on one line, or should they all be placed on a separate one? Tabs before the = to align them?

Also a one line sample is always good.
Ed suggests do we or do we not use tab to align =, this should be clarified.
Iirc in the places that we do use any initializer in the current code it is spaces on each side of = just as in assignment statements.

share/man/man9/style.9
327

"Likewise," is a noise word, can it be removed?

Can we add after his:
.Bd -literal
sample code
.Ed
please

Instead of referring C99 initializers, you can also say: initialization of structures and unions by record is preferred.

This review was a lot less controversial and bikesheddy before discussing prescribed syntax. I'd propose Warner just make the original, unopposed verbiage change and we trust people to do something reasonable. If it becomes a problem we can go into greater detail, but people already use C99 designed initializers in the project today and most use seems fine. Or, still make the original, unopposed change first, then open a 2nd separate review for the bikeshed.

Instead of referring C99 initializers, you can also say: initialization of structures and unions by record is preferred.

Isn't this just a less specific way of saying the same thing?

In D13975#293289, @ed wrote:

Is there a need to describe how these should be formatted? Can we place multiple initializers on one line, or should they all be placed on a separate one? Tabs before the = to align them?

No. There's no need. There's no pattern in the tree that's universal, so we should remain silent about this. The only thing that's generally done is separate lines, but even that's not universal.

share/man/man9/style.9
327

Likewise is in the style of the rest of the document, so I'll let other clean up the chatty style.
I'm loathe to add an example since there's a diversity of styles in the tree and it isn't clear to me which one to promulgate absent good statistical data.

In D13975#293403, @cem wrote:

This review was a lot less controversial and bikesheddy before discussing prescribed syntax. I'd propose Warner just make the original, unopposed verbiage change and we trust people to do something reasonable. If it becomes a problem we can go into greater detail, but people already use C99 designed initializers in the project today and most use seems fine. Or, still make the original, unopposed change first, then open a 2nd separate review for the bikeshed.

Instead of referring C99 initializers, you can also say: initialization of structures and unions by record is preferred.

Isn't this just a less specific way of saying the same thing?

I think it's changing allowed to preferred. :) Also, I find that wording to be less clear.

This revision was automatically updated to reflect the committed changes.