-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to printf.3 based on OpenBSD manual page structure #1200
base: main
Are you sure you want to change the base?
Conversation
This is a new pull request to address the questions/comments/suggestions as described in pull request: #1149 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed you changed the semantic Defined variable macro to the presentational Emphasis macro for stdout.
The semantic (regular) Variable macro (usually) renders the same way, how does everyone feel about using that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed you changed the semantic Defined variable macro to the presentational Emphasis macro for stdout.
The semantic (regular) Variable macro (usually) renders the same way, how does everyone feel about using that?
it looks good for stdout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally use Dv stdout
although there are a few instances of Em
and Va
. I would prefer Dv
.
Just curious, what kind of tooling are you using that's putting g's at the end of lines? |
no tooling, it is my finger typing that is causing the headache and i am working improving my neovim interaction to resolve this. |
lib/libc/stdio/printf.3
Outdated
.Fn asprintf | ||
and | ||
.Fn vasprintf | ||
dynamically allocate a new string with | ||
.Xr malloc 3 . | ||
.Xr malloc 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the previous one, "dynamically allocate a new string with malloc(3)." seems better than the explicit mentioning of "that is stored in ret." (ret is the return pointer, but confusing here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see that and it does read better having the ret removed, updates will have this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally use Dv stdout
although there are a few instances of Em
and Va
. I would prefer Dv
.
lib/libc/stdio/printf.3
Outdated
@@ -297,13 +335,14 @@ should be grouped and separated by thousands using | |||
the non-monetary separator returned by | |||
.Xr localeconv 3 . | |||
.El | |||
.It | |||
.Itg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Itg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved.
lib/libc/stdio/printf.3
Outdated
The | ||
.Vt double | ||
argument is rounded and converted in the style | ||
argument is rounded and converted tog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argument is rounded and converted tog | |
argument is rounded and converted to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
lib/libc/stdio/printf.3
Outdated
The exponent always contains at least two digits; if the value is zero, | ||
the exponent is 00. | ||
where the number of digits after the hexadecimal-point character | ||
is equal to theg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is equal to theg | |
is equal to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
lib/libc/stdio/printf.3
Outdated
respectively. | ||
These conversion characters are deprecated, and will eventually disappear. | ||
.It Cm eE | ||
to represent theg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to represent theg | |
to represent the |
lib/libc/stdio/printf.3
Outdated
.Li INFg | ||
org | ||
.Li -INF . | ||
If the argument is not-a-number (NaN), it is converted tog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the argument is not-a-number (NaN), it is converted tog | |
If the argument is not-a-number (NaN), it is converted to |
lib/libc/stdio/printf.3
Outdated
.It Cm B | ||
The | ||
.Vt unsigned int | ||
(or apporiate variant) argument is converted to unsigned binary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little thin compared to, say, o
or x
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree, would you recommend evaluating what o and x look like and see how it aligns with B since they are similar specifiers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
.It Cm b | ||
The | ||
.Vt unsigned int | ||
(or appropriate variant) argument is converted to unsigned binary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little thin compared to, say, o
or x
.
e9c0dca
to
4e42125
Compare
lib/libc/stdio/printf.3
Outdated
@@ -29,7 +29,10 @@ | |||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |||
.\" SUCH DAMAGE. | |||
.\" | |||
.Dd September 5, 2023 | |||
.\" - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.\" - |
lib/libc/stdio/printf.3
Outdated
.Pp | ||
.Cm A | ||
conversion uses the prefix | ||
.Dq Li 0X , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Ql macro is the preferred macro for formatting literal inline fragments. Historically, Dq Li was the preferred way before the deprecation of Li.
~style.mdoc(5)
With that change, would it appropriate to use Sq/Ql elsewhere as well for consistency? These render with single quotes on console, so it looks inconsistent from where where the file is previously using Dq.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not sure i am following. The recommendation is to make all from .Sq/.Ql -> .Dq basee on your reference?
and now we have some more details with b and B options, these updates are based on the wording and structure of the x and X documentation, with the necessary conversation to binary notation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm beginning to question how seriously you're taking this.
lib/libc/stdio/printf.3
Outdated
.Cm B | ||
.Sm on | ||
.Pp | ||
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant now.
Thank you all for the suggestions/comments/recommendations on this pull request. The latest one, has incorporated these changes along with the refinement of b and B options. The options were updated based on the std documentation shared. Please let me know if there is anything missing or refined. Again thank you for the guidance on this manual page update. |
Bug #247900 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247900 MFC: 1 week
|
.Pp | ||
Similar to | ||
.Cm b | ||
with the variation on the string value prefix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ungrammatical.
Similar to | ||
.Cm b | ||
with the variation on the string value prefix | ||
.Sq Ob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really?
with the variation on the string value prefix | ||
.Sq Ob | ||
to | ||
.Sq OB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really?
.Pp | ||
For non zero results the prefix | ||
.Sq 0b | ||
will be prepended to result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really? Always?
.Ar u | ||
except that the | ||
.Ar unsigned int | ||
argument is converted to unsigned octal notation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does o
now use different wording than b
and x
?
ping? what are the plans here? It can't land as it is, and the changes @dag-erling is suggesting are more intensive than I can do while prepping to land the change. |
i am currently working through @dag-erling recommendarions and requests. as it stands, it's going to be a little while.. is there a way to tag as "going slow but it's going"? |
I'm unsure. I'll check back every couple of weeks or so. Take your time. |
Bug #247900
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247900
printf.3
Update order of parameters alphabetically
Add parameter syntax to each parameter for clarity Untangle multiple opton entries into individual entries Update sentence structure throughout
Provide clarity on symbol based parameters