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)
Fri, Nov 29, 4:33 AM
Unknown Object (File)
Fri, Nov 29, 4:33 AM
Unknown Object (File)
Fri, Nov 29, 4:32 AM
Unknown Object (File)
Fri, Nov 29, 4:19 AM
Unknown Object (File)
Oct 2 2024, 8:29 PM
Unknown Object (File)
Oct 2 2024, 5:58 AM
Unknown Object (File)
Sep 30 2024, 4:16 AM
Unknown Object (File)
Sep 27 2024, 2:27 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #38186)

"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 ↗(On Diff #38186)

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.