Skip to content

Commit 1217ed4

Browse files
Taojunshencolin-homeopbld16opbld15opbld17
authored
8/25/2022 AM Publish (#4488)
* crtsetdbgflag.md: _CrtCheckMemory is not called by default * Visual C++ 17.0 has unlimited string literals * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> * wordsmith * clarify wording * wording * Update .openpublishing.publish.config.json * Repo sync for protected CLA branch (#4061) * add initial doc stubs * Initial docs push, contains stubs for some files and a stub for a landing page * update some links * add more cards and links to the Hub page * fix error * remove monikor's so it's easy to test, fix rtos-view.md path * fix link * add more to the sidebar * update peripheral view by consolidating to the table, change things to objects in rtos-view * add tabs * forgot to end tabbed section * fix items after adding tabs * update h1 * slightly fix some wording * add link from C++ and C workloads, features, and libraries to embedded hub * move into own directory so that the url is better * fix some warnings * remove next steps that pointed to linux items * prefer tabbed view vs table * attempt to add moniker * attempt highest moniker in range * assign to a specific version * push again to get new build * add '=' sign to try and test it * add metadata for msvc-170 * add moniker range for index.yml * remove inline moniker since we only need it on the files themselves * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown * Edit pass for house style * add 'while debugging' for peripheral-view * Fix table issue, stray punctuation Co-authored-by: Garrett Campbell <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: Alma Jenks <[email protected]> * Update ios-functions.md fix typo (#4071) showps→showpos * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4442) * 7/27/2022 AM Publish (#4432) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> * wordsmith * clarify wording * wording Co-authored-by: Feng Xu <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> * 7/28/2022 AM Publish (#4437) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> * wordsmith * clarify wording * wording Co-authored-by: Feng Xu <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> * 7/29/2022 AM Publish (#4441) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> * wordsmith * clarify wording * wording Co-authored-by: Feng Xu <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> Co-authored-by: Alma Jenks <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> * Address cpp-docs 4075 __assume issues * Address cpp-docs 4072 clarity issue * update date * Update multithreading-and-locales.md Wrong `setlocale()` reference, it should be a C runtime function, not a preprocessor macro. * Update for consistent branding. * Update peripheral view docs (#4444) * 7/27/2022 AM Publish (#4432) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> * wordsmith * clarify wording * wording Co-authored-by: Feng Xu <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> * 7/28/2022 AM Publish (#4437) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> * wordsmith * clarify wording * wording Co-authored-by: Feng Xu <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> * 7/29/2022 AM Publish (#4441) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> * wordsmith * clarify wording * wording Co-authored-by: Feng Xu <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> * add search/filter capability to peripheral view docs * add last column bar * Fixing alt-text Co-authored-by: Alma Jenks <[email protected]> Co-authored-by: Taojunshen <[email protected]> Co-authored-by: Feng Xu <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> Co-authored-by: Regan Downer <[email protected]> * Update the ARM64EC-related predefined macros * Update modules tutorial style * Updates for v17.3 * fix copypasta error * Fix dates * Add suggested fixes to corouptines warning * fix uppercase letter fix uppercase letter * fix github #4089 * acrolinx * wording change (#4467) Co-authored-by: TylerMSFT <[email protected]> * fix: ordered list #4055 * Describe why we add (STL) to the C++ Standard Library name (#4469) * wording change * address github 4092 * some acrolinx * update wording * a little more wordsmithing * fix github #4096 and follow up on PR feedback * acrolinx * pr feedback * fix line spacing * line spacing * really fixing line spacing... Co-authored-by: TylerMSFT <[email protected]> * Update link to LibFuzzer documentation Old link was to an ancient LLVM version which said that Windows wasn't supported * add naming note * style update * explain what the freestanding library is * Update Fatal Errors for VS2022 * Split up message text by source * wordsmith * typo * try table * try 3 columns * headers * headings * update headers * update headings * try to nullify warning * Split C999 from C1000, C1999, format table * Fixed inconsistent spelling of "newline" "newline" was spelled as "new-line" two out of four times in the document. * Missing error articles C2000-C2099 * Respelled "newline" as "new-line" * C26472 doc: gsl:narrow throws rather than crashes * Update intrinsic.md Remove extra '\' in the last row of tables, which actually show up in the doc. * C26475 doc: gsl:narrow throws rather than crashes * C26472 doc: Update style * draft to address github #4107 * acrolinx * fix broken link * typo * fix stray code markers * tech review * make params match old doc style * more fiddling with the wording * Remaining error articles in group * Remove redundant F1 tags * review feedbck * Update to address cpp-docs 4117 (#4485) * Update to address cpp-docs 4117 * Fix a typo. * Updated C6248 (#4436) * Updated C6248 Matched wording and format to my other PRs * Updated C6248 Used contractions per Acrolinx's mandate * Updated C6248 Using new formatting as discussed with Colin. Added PREfast name for warning. * Update docs/code-quality/c6248.md Co-authored-by: Michael Squires <[email protected]> * Updated C6248 Changed the ms.date and PREfast->code analysis Co-authored-by: Michael Squires <[email protected]> * Address cpp-docs issue 4097 (#4486) Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Oliver Old <[email protected]> Co-authored-by: Igor Zhukov <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: Feng Xu <[email protected]> Co-authored-by: JiayueHu <[email protected]> Co-authored-by: Bryan Gold <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: PRMerger20 <[email protected]> Co-authored-by: irushx <[email protected]> Co-authored-by: Garrett Campbell <[email protected]> Co-authored-by: Alma Jenks <[email protected]> Co-authored-by: pea-sys <[email protected]> Co-authored-by: PRMerger7 <[email protected]> Co-authored-by: Anton <[email protected]> Co-authored-by: Garrett Campbell <[email protected]> Co-authored-by: Regan Downer <[email protected]> Co-authored-by: Ben Niu <[email protected]> Co-authored-by: PRMerger19 <[email protected]> Co-authored-by: PRMerger4 <[email protected]> Co-authored-by: PRMerger Service account 2 <[email protected]> Co-authored-by: Gabor Horvath <[email protected]> Co-authored-by: Diana Richards <[email protected]> Co-authored-by: 薄景仁 <[email protected]> Co-authored-by: Linda Spiller <[email protected]> Co-authored-by: AugusMeow <[email protected]> Co-authored-by: Sy Brand <[email protected]> Co-authored-by: Dennis Rea <[email protected]> Co-authored-by: Weiju Wang <[email protected]> Co-authored-by: Bartosz Brachaczek <[email protected]> Co-authored-by: Bartosz Brachaczek <[email protected]> Co-authored-by: Stacyrch140 <[email protected]> Co-authored-by: Samuel Berger <[email protected]> Co-authored-by: Michael Squires <[email protected]>
1 parent f1bdf7f commit 1217ed4

22 files changed

+455
-171
lines changed

docs/c-language/inline-functions.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
---
22
description: "Learn more about: Inline Functions"
33
title: "Inline Functions"
4-
ms.date: 05/17/2022
4+
ms.date: 08/24/2022
55
helpviewer_keywords: ["fast code", "inline functions, __inline keyword", "functions [C++], inline functions"]
66
ms.assetid: 00f4b2ff-8ad0-4165-9f4c-2ef157d03f31
77
---
88
# Inline functions
99

10-
**Microsoft specific**
11-
12-
The **`__inline`** keyword tells the compiler to substitute the code within the function definition for every instance of a function call.
10+
The **`inline`** keyword is a function specifier that tells the compiler to substitute the code within the function definition for every instance of a function call.
1311

1412
## Remarks
1513

@@ -19,7 +17,7 @@ For a function to be considered as a candidate for inlining, it must use the new
1917

2018
Use this form to specify an inline function:
2119

22-
> **`__inline`** *function-definition*
20+
> **`inline`** *function-definition*
2321
2422
Inline functions generate faster and sometimes smaller code than the equivalent function call:
2523

@@ -29,7 +27,13 @@ Inline functions generate faster and sometimes smaller code than the equivalent
2927

3028
- The compiler can optimize functions generated inline in ways that aren't available to normal functions. The compiler doesn't usually perform optimizations between different procedures.
3129

32-
Don't confuse functions that use **`__inline`** with inline assembler code. For more information about inline assembler, see [Inline assembler](../c-language/inline-assembler-c.md).
30+
Don't confuse functions that use **`inline`** with inline assembler code. For more information about inline assembler, see [Inline assembler](../c-language/inline-assembler-c.md).
31+
32+
**Microsoft specific**
33+
34+
Microsoft also supports **`__inline`** and **`__forceinline`** keywords to tell the compiler to substitute the code within the function definition for every instance of a function call. The **`__inline`** keyword is a synonym for **`inline`**. The **`__forceinline`** keyword tells the compiler to relax the heuristics on whether to inline the function, though it doesn't guarantee a function will be inlined.
35+
36+
For compatibility with previous versions, **`_inline`** and **`_forceinline`** are synonyms for **`__inline`** and **`__forceinline`**, respectively, unless compiler option [`/Za` \(Disable language extensions)](../build/reference/za-ze-disable-language-extensions.md) is specified.
3337

3438
**END Microsoft specific**
3539

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
---
22
description: "Learn more about: _get_tzname"
33
title: "_get_tzname"
4-
ms.date: "4/2/2020"
4+
ms.date: 08/23/2022
55
api_name: ["_get_tzname", "_o__get_tzname"]
66
api_location: ["msvcrt.dll", "msvcr80.dll", "msvcr90.dll", "msvcr100.dll", "msvcr100_clr0400.dll", "msvcr110.dll", "msvcr110_clr0400.dll", "msvcr120.dll", "msvcr120_clr0400.dll", "ucrtbase.dll", "api-ms-win-crt-time-l1-1-0.dll", "api-ms-win-crt-private-l1-1-0.dll"]
77
api_type: ["DLLExport"]
88
topic_type: ["apiref"]
99
f1_keywords: ["_get_tzname", "get_tzname"]
1010
helpviewer_keywords: ["_get_tzname function", "time zones", "get_tzname function"]
11-
ms.assetid: df0065ff-095f-4237-832c-2fe9ab913875
1211
---
13-
# _get_tzname
12+
# `_get_tzname`
1413

15-
Retrieves the character string representation of the time zone name or the daylight standard time zone name (DST).
14+
Retrieves the character string representation of the time zone name or the daylight standard time (DST) zone name.
1615

1716
## Syntax
1817

@@ -27,51 +26,62 @@ errno_t _get_tzname(
2726

2827
### Parameters
2928

30-
*pReturnValue*<br/>
31-
The string length of *timeZoneName* including a null terminator.
29+
*`pReturnValue`*\
30+
The string length of *`timeZoneName`* including a `NULL` terminator.
3231

33-
*timeZoneName*<br/>
34-
The address of a character string for the representation of the time zone name or the daylight standard time zone name (DST), depending on *index*.
32+
*`timeZoneName`*\
33+
The address of a character string for the representation of the time zone name or the daylight standard time zone name (DST), depending on *`index`*.
3534

36-
*sizeInBytes*<br/>
37-
The size of the *timeZoneName* character string in bytes.
35+
*`sizeInBytes`*\
36+
The size of the *`timeZoneName`* character string in bytes.
3837

39-
*index*<br/>
40-
The index of one of the two time zone names to retrieve.
38+
*`index`*\
39+
The *`index`* of one of the two time zone names to retrieve.
4140

42-
|*index*|Contents of *timeZoneName*|*timeZoneName* default value|
41+
|*`index`*|Contents of *`timeZoneName`*|*`timeZoneName`* default value|
4342
|-|-|-|
44-
|0|Time zone name|"PST"|
45-
|1|Daylight standard time zone name|"PDT"|
46-
|> 1 or < 0|**errno** set to **EINVAL**|not modified|
43+
|0|Time zone name|`"PST"`|
44+
|1|Daylight standard time zone name|`"PDT"`|
45+
|> 1 or < 0|**`errno`** set to `EINVAL`|not modified|
4746

48-
Unless the values are explicitly changed during run time, the default values are "PST" and "PDT" respectively.
47+
Unless explicitly updated during runtime, `"PST"` is returned for the standard time zone and `"PDT"` for the daylight standard time zone. For more information, see the [Remarks](#remarks).
48+
49+
The time zone string isn't guaranteed to be the same between OS releases. Official time zone names can and do change.
4950

5051
## Return Value
5152

52-
Zero if successful, otherwise an **errno** type value.
53+
Zero if successful, otherwise an **`errno`** type value.
5354

54-
If either *timeZoneName* is **NULL**, or *sizeInBytes* is zero or less than zero (but not both), an invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function sets **errno** to **EINVAL** and returns **EINVAL**.
55+
If either *`timeZoneName`* is `NULL`, or *`sizeInBytes`* is zero or less than zero (but not both), an invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function sets **`errno`** to `EINVAL` and returns `EINVAL`.
5556

5657
### Error Conditions
5758

58-
|*pReturnValue*|*timeZoneName*|*sizeInBytes*|*index*|Return value|Contents of *timeZoneName*|
59+
|*`pReturnValue`*|*`timeZoneName`*|*`sizeInBytes`*|*`index`*|Return value|Contents of *`timeZoneName`*|
5960
|--------------------|--------------------|-------------------|-------------|------------------|--------------------------------|
60-
|size of TZ name|**NULL**|0|0 or 1|0|not modified|
61+
|size of TZ name|`NULL`|0|0 or 1|0|not modified|
6162
|size of TZ name|any|> 0|0 or 1|0|TZ name|
62-
|not modified|**NULL**|> 0|any|**EINVAL**|not modified|
63-
|not modified|any|zero|any|**EINVAL**|not modified|
64-
|not modified|any|> 0|> 1|**EINVAL**|not modified|
63+
|not modified|`NULL`|> 0|any|`EINVAL`|not modified|
64+
|not modified|any|zero|any|`EINVAL`|not modified|
65+
|not modified|any|> 0|> 1|`EINVAL`|not modified|
6566

6667
## Remarks
6768

68-
The **_get_tzname** function retrieves the character string representation of the current time zone name or the daylight standard time zone name (DST) into the address of *timeZoneName* depending on the index value, along with the size of the string in *pReturnValue*. If *timeZoneName* is **NULL** and *sizeInBytes* is zero, the size of the string required to hold the specified time zone and a terminating null in bytes is returned in *pReturnValue*. The index values must be either 0 for standard time zone or 1 for daylight standard time zone; any other values of *index* have undetermined results.
69+
The `_get_tzname` function retrieves the character string representation of the current time zone name or the daylight standard time zone name (DST) into the address of *`timeZoneName`* depending on the *`index`* value, along with the size of the string in *`pReturnValue`*. If *`timeZoneName`* is `NULL` and *`sizeInBytes`* is zero, the size of the string required to hold the specified time zone and a terminating `NULL` in bytes is returned in *`pReturnValue`*.
70+
71+
The *`index`* values must be either 0 for standard time zone or 1 for daylight standard time zone; any other values have undetermined results.
72+
73+
By default, `"PST"` is returned for the standard time zone and `"PDT"` for the daylight standard time zone. The true time zone name is updated the first time it's needed by a function that requires time zone information, such as [`strftime`](strftime-wcsftime-strftime-l-wcsftime-l.md), [`ftime`](ftime-ftime32-ftime64.md), [`ftime_s`](ftime-s-ftime32-s-ftime64-s.md), [`mktime`](mktime-mktime32-mktime64.md), [`localtime`](localtime-localtime32-localtime64.md), and others. If a function that doesn't require time zone information isn't called prior to calling `_get_tzname`, the default values are returned unless you first explicitly update them with one of the functions just mentioned, or a call to [`tzset()`](tzset.md). Also, if the `TZ` environment variable is set, it takes precedence over the time zone name reported by the OS. Even in this case, one of the functions mentioned above must be called before `_get_tzname` is called or the default time zone value will be returned. For more information about the `TZ` environment variable and the CRT, see [`_tzset`](tzset.md).
74+
75+
> [!WARNING]
76+
> The time zone string is not guaranteed to be the same between OS releases. Official time zone names can and do change.
6977
7078
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
7179

7280
## Example
7381

74-
This sample calls **_get_tzname** to get the required buffer size to display the current Daylight standard time zone name, allocates a buffer of that size, calls **_get_tzname** again to load the name in the buffer, and prints it to the console.
82+
This sample calls `_get_tzname` to get the required buffer size to display the current Daylight standard time zone name, allocates a buffer of that size, calls `_get_tzname` again to load the name in the buffer, and prints it to the console.
83+
84+
It also calls `_tzset()` to cause the OS to update the time zone information before calling `_get_tzname()`. Otherwise, the default values are used.
7585

7686
```C
7787
// crt_get_tzname.c
@@ -80,7 +90,7 @@ This sample calls **_get_tzname** to get the required buffer size to display the
8090
#include <time.h>
8191
#include <malloc.h>
8292

83-
enum TZINDEX {
93+
enum TZindex {
8494
STD,
8595
DST
8696
};
@@ -90,17 +100,25 @@ int main()
90100
size_t tznameSize = 0;
91101
char * tznameBuffer = NULL;
92102

103+
_tzset(); // Update the time zone information
104+
93105
// Get the size of buffer required to hold DST time zone name
94106
if (_get_tzname(&tznameSize, NULL, 0, DST))
107+
{
95108
return 1; // Return an error value if it failed
109+
}
96110

97111
// Allocate a buffer for the name
98112
if (NULL == (tznameBuffer = (char *)(malloc(tznameSize))))
113+
{
99114
return 2; // Return an error value if it failed
115+
}
100116

101117
// Load the name in the buffer
102118
if (_get_tzname(&tznameSize, tznameBuffer, tznameSize, DST))
119+
{
103120
return 3; // Return an error value if it failed
121+
}
104122

105123
printf_s("The current Daylight standard time zone name is %s.\n", tznameBuffer);
106124
return 0;
@@ -110,21 +128,21 @@ int main()
110128
### Output
111129

112130
```Output
113-
The current Daylight standard time zone name is PDT.
131+
The current Daylight standard time zone name is Pacific Daylight Time.
114132
```
115133

116134
## Requirements
117135

118136
|Routine|Required header|
119137
|-------------|---------------------|
120-
|**_get_tzname**|\<time.h>|
138+
|`_get_tzname`|`<time.h>`|
121139

122140
For more information, see [Compatibility](../../c-runtime-library/compatibility.md).
123141

124142
## See also
125143

126-
[Time Management](../../c-runtime-library/time-management.md)<br/>
127-
[errno, _doserrno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md)<br/>
128-
[_get_daylight](get-daylight.md)<br/>
129-
[_get_dstbias](get-dstbias.md)<br/>
130-
[_get_timezone](get-timezone.md)<br/>
144+
[Time Management](../../c-runtime-library/time-management.md)\
145+
[`errno`, `_doserrno`, `_sys_errlist`, and `_sys_nerr`](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md)\
146+
[`_get_daylight`](get-daylight.md)\
147+
[`_get_dstbias`](get-dstbias.md)\
148+
[`_get_timezone`](get-timezone.md)

0 commit comments

Comments
 (0)