Skip to content

fopen-wfopen.md: initial comma for ccs= option #4234

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

Closed
wants to merge 1 commit into from

Conversation

skissane
Copy link
Contributor

Unlike the other mode options, ccs= must always be prefixed with a comma. The examples made this clear, but the table and text didn't. I think that point is made more obvious if one always writes ,ccs=

Unlike the other mode options, `ccs=` must always be prefixed with a comma.
The examples made this clear, but the table and text didn't.
I think that point is made more obvious if one always writes `,ccs=`
@prmerger-automator
Copy link
Contributor

@skissane : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@opbld30
Copy link

opbld30 commented Oct 19, 2022

Learn Build status updates of commit 3b51ee0:

✅ Validation status: passed

File Status Preview URL Details
docs/c-runtime-library/reference/fopen-wfopen.md ✅Succeeded

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@Court72
Copy link
Contributor

Court72 commented Oct 20, 2022

@TylerMSFT

Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, add a #sign-off comment to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged Tracking label for the PR review team label Oct 20, 2022
@TylerMSFT
Copy link
Collaborator

Hi @skissane,
Thank you for taking an interest in the docs.
The comma isn't part of the flag. It's there because the ccs flag is following another argument. Although it needs to follow the mode argument (meaning it'll usually be separated from the previous mode argument by a comma), that doesn't mean the comma is part of the flag. It's just part of following another parameter. It would be confusing if we suggested in the docs that argument delimiters were part of the definition of the flag when that flag has some sort of positional requirement because it's not part of the flag--it's just normal parameter passing.
It's awesome of you to notice something that strikes you funny and take the time to make a contribution. In this case, I don't think we will include it in the official docs, though.

@TylerMSFT TylerMSFT closed this Oct 21, 2022
@skissane
Copy link
Contributor Author

@TylerMSFT I take your point point about the comma not actually being part of the flag.

I do still think there is an issue here though. fopen() mode flags fall into two groups:
(1) firstly, single character flags
(2) subsequently, comma-separated keyword flags, such as ccs

Only (1) is standardised as part of the ISO C standard, although the C99 rationale document (see section 7.19.5.3, page numbered 150, PDF page 157) gives an example of (2) as a possible extension. For Windows UCRT, ccs is the only supported comma-separated keyword flag; likewise, for GNU C Library, it is the only supported comma-separated flag. However, on some other platforms (for example, IBM z/OS), there are many more comma-separated keyword flags.

Anyway, my point is, the documentation text never clearly explains that ccs has a rather different syntax from all the other flags. On the contrary, it puts it in the same table with all the others. The examples in the docs do show this, but I think it would be easier for people to understand if it was explicitly stated in the text.

Maybe my proposed change was not the best way of communicating this, but I do think the documentation would be more understandable if this fact was made explicit, somehow.

@TylerMSFT
Copy link
Collaborator

@skissane , I addressed your point by adding the following to the css entry in the table: This flag is separated from flags that precede it by a comma (,). For example: FILE *f = fopen("newfile.txt", "rt+, ccs=UTF-8"); It should be live by end of day Thursday (12/22) Happy holidays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants