Skip to content

Add io.h header into example code#3343

Closed
NikoAri wants to merge 1 commit into
MicrosoftDocs:masterfrom
NikoAri:patch-1
Closed

Add io.h header into example code#3343
NikoAri wants to merge 1 commit into
MicrosoftDocs:masterfrom
NikoAri:patch-1

Conversation

@NikoAri

@NikoAri NikoAri commented Aug 31, 2021

Copy link
Copy Markdown
Contributor

Repro:

  1. Paste sample code for _get_errno is placed into new Visual Studio 2019 project
  2. Try to compile

Result:
Compilation fails
The error is:
Error C3861 '_sopen_s': identifier not found

Expected Result:
Sample code should just compile

Fix:
Add io.h header file to avoid the above error in sample code.

Repro:

1. Paste sample code for _get_errno is placed into new Visual Studio 2019 project
1. Try to compile

Result:
Compilation fails
The error is:
Error	C3861	'_sopen_s': identifier not found	

Expected Result:
Sample code should just compile

Fix:
Add io.h header file to avoid the above error in sample code.
@PRMerger17

Copy link
Copy Markdown
Contributor

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

@TylerMSFT TylerMSFT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @NikoAri! Really appreciate you not only seeing what's wrong, but fixing it. That's fantastic.
Your changes are good. If you want, you could also remove #include <share.h> as part of this, I think. If you'd like to do that, I'll approve the changes right after.

@NikoAri

NikoAri commented Sep 1, 2021

Copy link
Copy Markdown
Contributor Author

Created new PR with requested change:
#3345

@NikoAri

NikoAri commented Sep 1, 2021

Copy link
Copy Markdown
Contributor Author

New PR Link:
#3345

@NikoAri NikoAri closed this Sep 1, 2021
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.

5 participants