Skip to content

Commit 56066ac

Browse files
author
Colin Robertson
committed
Standardize use of POSIX
1 parent 605def2 commit 56066ac

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

docs/c-runtime-library/errno-constants.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The following **errno** values are supported:
4444
|**EXDEV**|Cross-device link. An attempt was made to move a file to a different device (using the **rename** function).|
4545
|**STRUNCATE**|A string copy or concatenation resulted in a truncated string. See [_TRUNCATE](../c-runtime-library/truncate.md).
4646

47-
The following values are supported for compatibility with Posix. They are required values on non-Posix systems.
47+
The following values are supported for compatibility with POSIX. They are required values on non-POSIX systems.
4848

4949
```C
5050
#define E2BIG /* argument list too long */

docs/c-runtime-library/reference/itoa-itow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ wchar_t * _ultow( unsigned long value, wchar_t *buffer, int radix );
2828
wchar_t * _i64tow( long long value, wchar_t *buffer, int radix );
2929
wchar_t * _ui64tow( unsigned long long value, wchar_t *buffer, int radix );
3030

31-
// These Posix versions of the functions have deprecated names:
31+
// These POSIX versions of the functions have deprecated names:
3232
char * itoa( int value, char *buffer, int radix );
3333
char * ltoa( long value, char *buffer, int radix );
3434
char * ultoa( unsigned long value, char *buffer, int radix );
@@ -102,9 +102,9 @@ To use these functions without the deprecation warning, define the **_CRT_SECURE
102102

103103
In C++, these functions have template overloads that invoke their safer counterparts. For more information, see [Secure Template Overloads](../../c-runtime-library/secure-template-overloads.md).
104104

105-
The Posix names **itoa**, **ltoa**, and **ultoa** exist as aliases for the **_itoa**, **_ltoa**, and **_ultoa** functions. The Posix names are deprecated because they do not follow the implementation-specific function name conventions of ISO C. By default, these functions cause deprecation warning [C4996](../../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md): **The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name:** *new_name*. We recommend you change your source code to use the safer versions of these functions, **_itoa_s**, **_ltoa_s**, or **_ultoa_s**. For more information, see [_itoa_s, _itow_s functions](itoa-s-itow-s.md).
105+
The POSIX names **itoa**, **ltoa**, and **ultoa** exist as aliases for the **_itoa**, **_ltoa**, and **_ultoa** functions. The POSIX names are deprecated because they do not follow the implementation-specific global function name conventions of ISO C. By default, these functions cause deprecation warning [C4996](../../error-messages/compiler-warnings/compiler-warning-level-3-c4996.md): **The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name:** *new_name*. We recommend you change your source code to use the safer versions of these functions, **_itoa_s**, **_ltoa_s**, or **_ultoa_s**. For more information, see [_itoa_s, _itow_s functions](itoa-s-itow-s.md).
106106

107-
For source code portability, you may prefer to retain the Posix names in your code. To use these functions without the deprecation warning, define both the **_CRT_NONSTDC_NO_WARNINGS** and **_CRT_SECURE_NO_WARNINGS** preprocessor macros before including any CRT headers. You can do this on the command line in a developer command prompt by adding the **/D_CRT_SECURE_NO_WARNINGS** and **/D_CRT_NONSTDC_NO_WARNINGS** compiler options to the **cl** command. Otherwise, define the macros in your source files. If you use precompiled headers, define the macros at the top of the precompiled header include file. To define the macros in your source code, use **#define** directives before you include any CRT header, as in this example:
107+
For source code portability, you may prefer to retain the POSIX names in your code. To use these functions without the deprecation warning, define both the **_CRT_NONSTDC_NO_WARNINGS** and **_CRT_SECURE_NO_WARNINGS** preprocessor macros before including any CRT headers. You can do this on the command line in a developer command prompt by adding the **/D_CRT_SECURE_NO_WARNINGS** and **/D_CRT_NONSTDC_NO_WARNINGS** compiler options to the **cl** command. Otherwise, define the macros in your source files. If you use precompiled headers, define the macros at the top of the precompiled header include file. To define the macros in your source code, use **#define** directives before you include any CRT header, as in this example:
108108

109109
```C
110110
#define _CRT_NONSTDC_NO_WARNINGS 1

docs/error-messages/compiler-warnings/compiler-warning-level-3-c4996.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Your code uses a function, class member, variable, or typedef that's marked *dep
1515
1616
## Remarks
1717

18-
Many functions, member functions, template functions, and global variables in Visual Studio libraries are *deprecated*. Some, such as Posix functions, are deprecated because they have a different preferred name. Some C runtime library functions are deprecated because they're insecure and have a more secure variant. Others are deprecated because they're obsolete. The deprecation messages usually include a suggested replacement for the deprecated function or global variable.
18+
Many functions, member functions, template functions, and global variables in Visual Studio libraries are *deprecated*. Some, such as POSIX and Microsoft-specific functions, are deprecated because they now have a different preferred name. Some C runtime library functions are deprecated because they're insecure and have a more secure variant. Others are deprecated because they're obsolete. The deprecation messages usually include a suggested replacement for the deprecated function or global variable.
1919

2020
## Turn off the warning
2121

@@ -53,9 +53,9 @@ Here are some of the common sources of C4996 warnings and errors:
5353

5454
**The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name:** *new-name*. **See online help for details.**
5555

56-
Microsoft renamed some POSIX functions in the CRT to conform with C99 and C++03 rules for implementation-defined global function names. Only the names are deprecated, not the functions themselves. In most cases, a leading underscore was added to the POSIX function name to create a standards conformant name. The compiler issues a deprecation warning for the original function name, and suggests the preferred name.
56+
Microsoft renamed some POSIX and Microsoft-specific library functions in the CRT to conform with C99 and C++03 constraints on reserved and global implementation-defined names. *Only the names are deprecated, not the functions themselves*. In most cases, a leading underscore was added to the function name to create a conforming name. The compiler issues a deprecation warning for the original function name, and suggests the preferred name.
5757

58-
To fix this issue, we usually recommend you change your code to use the suggested function names instead. However, the updated names are Microsoft-specific. If you need to use the existing function names for portability reasons, you can turn off these warnings. The POSIX functions are still available in the library under their original names.
58+
To fix this issue, we usually recommend you change your code to use the suggested function names instead. However, the updated names are Microsoft-specific. If you need to use the existing function names for portability reasons, you can turn off these warnings. The functions are still available in the library under their original names.
5959

6060
To turn off deprecation warnings for these functions, define the preprocessor macro **\_CRT\_NONSTDC\_NO\_WARNINGS**. You can define this macro at the command line by including the option `/D_CRT_NONSTDC_NO_WARNINGS`.
6161

docs/standard-library/filesystem-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ path system_complete(const path& pval);
479479
path system_complete(const path& pval, error_code& ec);
480480
```
481481

482-
The functions return an absolute pathname that takes into account, as necessary, the current directory associated with its root name. \(For Posix, the functions return `absolute(pval)`.\)
482+
The functions return an absolute pathname that takes into account, as necessary, the current directory associated with its root name. \(For POSIX, the functions return `absolute(pval)`.\)
483483

484484
## <a name="temp_directory_path"></a> temp_directory_path
485485

docs/standard-library/filesystem.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ using namespace std::experimental::filesystem::v1;
1919
> [!IMPORTANT]
2020
> As of the release of Visual Studio 2017, the \<filesystem> header was not yet a C++ standard. C++ in Visual Studio 2017 (MSVC v141) implements the final draft standard, found in [ISO/IEC JTC 1/SC 22/WG 21 N4100](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf).
2121
22-
This header supports filesystems for one of two broad classes of host operating systems: Microsoft Windows and Posix.
22+
This header supports filesystems for one of two broad classes of host operating systems: Microsoft Windows and POSIX.
2323
2424
While most functionality is common to both operating systems, this document identifies where differences occur. For example:
2525
2626
- Windows supports multiple root names, such as c: or \\\network_name. A filesystem consists of a forest of trees, each with its own root directory, such as c:\ or \\\network_name\\, and each with its own current directory, for completing a relative pathname (one that is not an absolute pathname).
2727
28-
- Posix supports a single tree, with no root name, the single root directory /, and a single current directory.
28+
- POSIX supports a single tree, with no root name, the single root directory /, and a single current directory.
2929
3030
Another significant difference is the native representation of pathnames:
3131
3232
- Windows uses a null-terminated sequence of wchar_t, encoded as UTF-16 (one or two elements for each character).
3333
34-
- Posix uses a null-terminated sequence of char, encoded as UTF-8 (one or more elements for each character).
34+
- POSIX uses a null-terminated sequence of char, encoded as UTF-8 (one or more elements for each character).
3535
3636
- An object of class path stores the pathname in native form, but supports easy conversion between this stored form and several external forms:
3737
@@ -51,7 +51,7 @@ Another difference is the detail with which each operating system lets you speci
5151
5252
1. Windows records whether a file is read only or writable, an attribute that has no meaning for directories.
5353
54-
1. Posix records whether a file can be read, written, or executed (scanned if a directory), by the owner, by the owner's group, or by everybody, plus a few other permissions.
54+
1. POSIX records whether a file can be read, written, or executed (scanned if a directory), by the owner, by the owner's group, or by everybody, plus a few other permissions.
5555
5656
Common to both systems is the structure imposed on a pathname once you get past the root name. For the pathname c:/abc/xyz/def.ext:
5757

docs/standard-library/locale-class.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ messages<char>
8585
messages<wchar_t>
8686
```
8787

88-
(The last category is required by Posix, but not the C Standard.)
88+
(The last category is required by POSIX, but not the C Standard.)
8989

9090
Some of these predefined facets are used by the `iostream` classes, to control the conversion of numeric values to and from text sequences.
9191

@@ -193,7 +193,7 @@ The type is a synonym for an **int** type that can represent a group of distinct
193193

194194
- `time`, corresponding to the C category LC_TIME
195195

196-
- `messages`, corresponding to the Posix category LC_MESSAGES
196+
- `messages`, corresponding to the POSIX category LC_MESSAGES
197197

198198
Two more useful values are:
199199

docs/standard-library/path-class.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class path;
5858
|[has_root_name](#has_root_name)|Returns `!root_name().empty()`.|
5959
|[has_root_path](#has_root_path)|Returns `!root_path().empty()`.|
6060
|[has_stem](#has_stem)|Returns `!stem().empty()`.|
61-
|[is_absolute](#is_absolute)|For Windows, the function returns `has_root_name() && has_root_directory()`. For Posix, the function returns `has_root_directory()`.|
61+
|[is_absolute](#is_absolute)|For Windows, the function returns `has_root_name() && has_root_directory()`. For POSIX, the function returns `has_root_directory()`.|
6262
|[is_relative](#is_relative)|Returns `!is_absolute()`.|
6363
|[make_preferred](#make_preferred)|Converts each separator to a preferred_separator as needed.|
6464
|[native](#native)|Returns `myname`.|
@@ -369,7 +369,7 @@ bool has_stem() const;
369369

370370
## <a name="is_absolute"></a> path::is_absolute
371371

372-
For Windows, the function returns `has_root_name() && has_root_directory()`. For Posix, the function returns `has_root_directory()`.
372+
For Windows, the function returns `has_root_name() && has_root_directory()`. For POSIX, the function returns `has_root_directory()`.
373373

374374
```cpp
375375
bool is_absolute() const;
@@ -626,7 +626,7 @@ The constant object gives the preferred character for separating path components
626626
```cpp
627627
#if _WIN32_C_LIB
628628
static constexpr value_type preferred_separator == L'\\';
629-
#else // assume Posix
629+
#else // assume POSIX
630630
static constexpr value_type preferred_separator == '/';
631631
#endif // filesystem model now defined
632632
```
@@ -815,7 +815,7 @@ The type describes the `path` elements favored by the host operating system.
815815
```cpp
816816
#if _WIN32_C_LIB
817817
typedef wchar_t value_type;
818-
#else // assume Posix
818+
#else // assume POSIX
819819
typedef char value_type;
820820
#endif // filesystem model now defined
821821
```

docs/standard-library/system-error-enums.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.assetid: b21321b7-404a-40de-8777-a85b77c6fa58
88

99
## <a name="errc"></a> errc
1010

11-
Provides symbolic names for all the error-code macros defined by Posix in `<errno.h>`.
11+
Provides symbolic names for all the error-code macros defined by POSIX in `<errno.h>`.
1212

1313
```
1414
class errc {

docs/standard-library/system-error.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Include the header \<system_error> to define the exception class `system_error`
4646

4747
|||
4848
|-|-|
49-
|[errc](../standard-library/system-error-enums.md#errc)|Provides symbolic names for all the error-code macros defined by Posix in `<errno.h>`.|
49+
|[errc](../standard-library/system-error-enums.md#errc)|Provides symbolic names for all the error-code macros defined by POSIX in `<errno.h>`.|
5050

5151
### Classes and Structs
5252

docs/text/string-and-i-o-formatting-modern-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Some advantages of `Boost.Format` are:
4545

4646
- Extensible: Works for any type that can be streamed.
4747

48-
- Convenient: Standard Posix and similar format strings.
48+
- Convenient: Standard POSIX and similar format strings.
4949

5050
Although `Boost.Format` is built on C++ [\<iostream>](../standard-library/iostream-programming.md) facilities, which are safe and extensible, they aren't performance-optimized. When you require performance optimization, consider C [printf](../c-runtime-library/reference/printf-printf-l-wprintf-wprintf-l.md) and [sprintf](../c-runtime-library/reference/sprintf-sprintf-l-swprintf-swprintf-l-swprintf-l.md), which are fast and easy to use. However, they aren't extensible or safe from vulnerabilities. (Safe versions exist, but they incur a slight performance penalty. For more information, see [printf_s, _printf_s_l, wprintf_s, _wprintf_s_l](../c-runtime-library/reference/printf-s-printf-s-l-wprintf-s-wprintf-s-l.md) and [sprintf_s, _sprintf_s_l, swprintf_s, _swprintf_s_l](../c-runtime-library/reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l.md)).
5151

0 commit comments

Comments
 (0)