Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/atl-mfc-shared/reference/coledatetime-class.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "COleDateTime Class"
ms.date: "03/27/2019"
description: "API reference for the MFC COleDateTime class which Encapsulates the `DATE` data type used in OLE automation."
ms.date: "08/27/2020"
f1_keywords: ["COleDateTime", "ATLCOMTIME/ATL::COleDateTime", "ATLCOMTIME/ATL::COleDateTime::COleDateTime", "ATLCOMTIME/ATL::COleDateTime::Format", "ATLCOMTIME/ATL::COleDateTime::GetAsDBTIMESTAMP", "ATLCOMTIME/ATL::COleDateTime::GetAsSystemTime", "ATLCOMTIME/ATL::COleDateTime::GetAsUDATE", "ATLCOMTIME/ATL::COleDateTime::GetCurrentTime", "ATLCOMTIME/ATL::COleDateTime::GetDay", "ATLCOMTIME/ATL::COleDateTime::GetDayOfWeek", "ATLCOMTIME/ATL::COleDateTime::GetDayOfYear", "ATLCOMTIME/ATL::COleDateTime::GetHour", "ATLCOMTIME/ATL::COleDateTime::GetMinute", "ATLCOMTIME/ATL::COleDateTime::GetMonth", "ATLCOMTIME/ATL::COleDateTime::GetSecond", "ATLCOMTIME/ATL::COleDateTime::GetStatus", "ATLCOMTIME/ATL::COleDateTime::GetYear", "ATLCOMTIME/ATL::COleDateTime::ParseDateTime", "ATLCOMTIME/ATL::COleDateTime::SetDate", "ATLCOMTIME/ATL::COleDateTime::SetDateTime", "ATLCOMTIME/ATL::COleDateTime::SetStatus", "ATLCOMTIME/ATL::COleDateTime::SetTime", "ATLCOMTIME/ATL::COleDateTime::m_dt", "ATLCOMTIME/ATL::COleDateTime::m_status"]
helpviewer_keywords: ["shared classes, COleDateTime", "time-only values", "Date data type, MFC encapsulation of", "COleDateTime class", "dates, handling in MFC", "time, handling in MFC"]
ms.assetid: e718f294-16ec-4649-88b6-a4dbae5178fb
Expand Down Expand Up @@ -419,7 +420,7 @@ For information on other member functions that query the value of this `COleDate

## <a name="getdayofweek"></a> COleDateTime::GetDayOfWeek

Gets the day of the month represented by this date/time value.
Gets the day of the week represented by this date/time value.

```
int GetDayOfWeek() const throw();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "snprintf, _snprintf, _snprintf_l, _snwprintf, _snwprintf_l"
ms.date: "11/04/2016"
description: "API reference for snprintf, _snprintf, _snprintf_l, _snwprintf, _snwprintf_, which write formatted data to a string."
ms.date: "08/27/2020"
api_name: ["_snwprintf", "_snprintf", "_snprintf_l", "_snwprintf_l", "snprintf"]
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", "ntoskrnl.exe"]
api_type: ["DLLExport"]
Expand Down Expand Up @@ -101,7 +102,7 @@ For more information, see [Format Specification Syntax: printf and wprintf Funct

## Return Value

Let **len** be the length of the formatted data string, not including the terminating null. Both **len** and *count* are in bytes for **snprintf** and **_snprintf**, wide characters for **_snwprintf**.
Let **len** be the length of the formatted data string, not including the terminating null. Both **len** and **count** are the number of characters for **snprintf** and **_snprintf**, and the number of wide characters for **_snwprintf**.

For all functions, if **len** < *count*, **len** characters are stored in *buffer*, a null-terminator is appended, and **len** is returned.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "strtod, _strtod_l, wcstod, _wcstod_l"
ms.date: "4/2/2020"
description: "API reference for strtod, _strtod_l, wcstod, _wcstod_l, which convert strings to a double-precision value."
ms.date: "08/27/2020"
api_name: ["wcstod", "_wcstod_l", "_strtod_l", "strtod", "_o__strtod_l", "_o__wcstod_l", "_o_strtod", "_o_wcstod"]
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-convert-l1-1-0.dll", "api-ms-win-crt-private-l1-1-0.dll"]
api_type: ["DLLExport"]
Expand Down Expand Up @@ -49,7 +50,7 @@ The locale to use.

## Return Value

**strtod** returns the value of the floating-point number, except when the representation would cause an overflow, in which case the function returns +/-**HUGE_VAL**. The sign of **HUGE_VAL** matches the sign of the value that cannot be represented. **strtod** returns `0` if no conversion can be performed or an underflow occurs.
**strtod** returns the value of the floating-point number, except when the representation would cause an overflow, in which case the function returns +/-**HUGE_VAL**. The sign of **HUGE_VAL** matches the sign of the value that can't be represented. **strtod** returns `0` if no conversion can be performed or an underflow occurs.

**wcstod** returns values analogously to **strtod**:

Expand All @@ -60,7 +61,7 @@ For more information on this and other return codes, see [_doserrno, errno, _sys

## Remarks

Each function converts the input string *strSource* to a **`double`**. The **strtod** function converts *strSource* to a double-precision value. **strtod** stops reading the string *strSource* at the first character it cannot recognize as part of a number. This character may be the terminating null character. **wcstod** is a wide-character version of **strtod**; its *strSource* argument is a wide-character string. These functions behave identically otherwise.
Each function converts the input string *strSource* to a **`double`**. The **strtod** function converts *strSource* to a double-precision value. **strtod** stops reading the string *strSource* at the first character it can't recognize as part of a number. This character may be the terminating null character. **wcstod** is a wide-character version of **strtod**; its *strSource* argument is a wide-character string. These functions behave identically otherwise.

By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).

Expand All @@ -78,11 +79,26 @@ If *endptr* isn't **NULL**, a pointer to the character that stopped the scan is
**strtod** expects *strSource* to point to a string of one of the following forms:

[*whitespace*] [*sign*] {*digits* [*radix* *digits*] &#124; *radix* *digits*} [{**e** &#124; **E**} [*sign*] *digits*]
[*whitespace*] [*sign*] {**0x** &#124; **0X**} {*hexdigits* [*radix* *hexdigits*] &#124; *radix* *hexdigits*} [{**p** &#124; **P**} [*sign*] *hexdigits*]
[*whitespace*] [*sign*] {**0x** &#124; **0X**} {*hexdigits* [*radix* *hexdigits*] &#124; *radix* *hexdigits*} [{**p** &#124; **P**} [*sign*] *digits*]
[*whitespace*] [*sign*] {**INF** &#124; **INFINITY**}
[*whitespace*] [*sign*] **NAN** [*sequence*]

The optional leading *whitespace* may consist of space and tab characters, which are ignored; *sign* is either plus (+) or minus (-); *digits* are one or more decimal digits; *hexdigits* are one or more hexadecimal digits; *radix* is the radix point character, either a period (.) in the default "C" locale, or the locale-specific value if the current locale is different or when *locale* is specified; a *sequence* is a sequence of alphanumeric or underscore characters. In both decimal and hexadecimal number forms, if no digits appear before the radix point character, at least one must appear after the radix point character. In the decimal form, the decimal digits can be followed by an exponent, which consists of an introductory letter (**e** or **E**) and an optionally signed integer. In the hexadecimal form, the hexadecimal digits can be followed by an exponent, which consists of an introductory letter (**p** or **P**) and an optionally signed hexadecimal integer that represents the exponent as a power of 2. In either form, if there isn't an exponent part or a radix point character, a radix point character is assumed to follow the last digit in the string. Case is ignored in both the **INF** and **NAN** forms. The first character that doesn't fit one of these forms stops the scan.
The optional leading *whitespace* may consist of space and tab characters, which are ignored.\
*sign* is either plus (+) or minus (-).\
*digits* are one or more decimal digits.\
*hexdigits* are one or more hexadecimal digits.\
*radix* is the radix point character, either a period (.) in the default "C" locale, or the locale-specific value if the current locale is different or when *locale* is specified.\
A *sequence* is a sequence of alphanumeric or underscore characters.

In both decimal and hexadecimal number forms, if no digits appear before the radix point character, at least one must appear after the radix point character.

In the decimal form, the decimal digits can be followed by an exponent, which consists of an introductory letter (**e** or **E**) and an optionally signed integer.

In the hexadecimal form, the hexadecimal digits can be followed by an exponent, which consists of an introductory letter (**p** or **P**) and an optionally signed decimal integer that represents the exponent as a power of 2.

In either form, if there isn't an exponent part or a radix point character, a radix point character is assumed to follow the last digit in the string.

Case is ignored in both the **INF** and **NAN** forms. The first character that doesn't fit one of these forms stops the scan.

The UCRT versions of these functions don't support conversion of Fortran-style (**d** or **D**) exponent letters. This non-standard extension was supported by earlier versions of the CRT, and may be a breaking change for your code. The UCRT versions support hexadecimal strings and round-tripping of INF and NAN values, which weren't supported in earlier versions. This can also cause breaking changes in your code. For example, the string "0x1a" would be interpreted by **strtod** as 0.0 in previous versions, but as 26.0 in the UCRT version.

Expand Down
37 changes: 31 additions & 6 deletions docs/code-quality/c26447.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
---
title: C26447
ms.date: 03/22/2018
description: "Microsoft C++ Code Analysis warning C26447 for the C++ Core Guidelines case F.6."
ms.date: 08/25/2020
ms.topic: reference
f1_keywords: ["C26447"]
helpviewer_keywords: ["C26447"]
---
# C26447 DONT_THROW_IN_NOEXCEPT

The function is declared **`noexcept`** but calls a function that may throw exceptions.
> The function is declared `noexcept` but calls function *function_name* that may throw exceptions (f.6).

C++ Core Guidelines:
C++ Core Guidelines:\
[F.6: If your function may not throw, declare it noexcept](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#f6-if-your-function-may-not-throw-declare-it-noexcept).

This rule amends another rule, [C26440 DECLARE_NOEXCEPT](c26440.md), which tries to find functions that are good candidates to be marked as **`noexcept`**. In this case, the idea is that once some function is marked as **`noexcept`**, it must keep its contract by not invoking other code that may throw exceptions.
## Remarks

This rule amends another rule, [C26440 DECLARE_NOEXCEPT](c26440.md), which tries to find functions that are good candidates to mark as **`noexcept`**. In this case, the idea is that once you mark some function as **`noexcept`**, it must keep its contract by not invoking other code that may throw exceptions.

- The Microsoft C++ compiler already handles straightforward violations like **`throw`** statements in the function body (see [C4297](/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4297)).
- The rule focuses only on function calls. It flags targets that are not **`constexpr`** and that can potentially throw exceptions; in other words they are not marked explicitly as non-throwing by using **`noexcept`**, **`__declspec(nothrow)`**, **throw()**.
- The rule focuses only on function calls. It flags targets that aren't **`constexpr`** and that can potentially throw exceptions. In other words, they aren't marked explicitly as non-throwing by using **`noexcept`**, **`__declspec(nothrow)`**, or **throw()**.
- The compiler-generated target functions are skipped to reduce noise since exception specifications are not always provided by the compiler.
- The checker also skips special kinds of target functions that are expected to be implemented as **`noexcept`**; this rule is enforced by [C26439 SPECIAL_NOEXCEPT](c26439.md).
- The checker also skips special kinds of target functions we expect you to implement as **`noexcept`**; this rule is enforced by [C26439 SPECIAL_NOEXCEPT](c26439.md).

## Example

```cpp
#include <vector>
#include <string>
#include <istream>

std::vector<std::string> collect(std::istream& is) noexcept
{
std::vector<std::string> res;
for (std::string s; is >> s;) // C26447, `operator bool()` can throw, std::string's allocator can throw
res.push_back(s); // C26447, `push_back` can throw
return res;
}
```

You can fix these warnings by removing **`noexcept`** from the function signature.

## See also

[C26440 DECLARE_NOEXCEPT](c26440.md)
6 changes: 4 additions & 2 deletions docs/mfc/reference/ccombobox-class.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "CComboBox Class"
ms.date: "11/04/2016"
description: "API reference for the MFC Windows combo box class CComboBox"
ms.date: "08/27/2020"
f1_keywords: ["CComboBox", "AFXWIN/CComboBox", "AFXWIN/CComboBox::CComboBox", "AFXWIN/CComboBox::AddString", "AFXWIN/CComboBox::Clear", "AFXWIN/CComboBox::CompareItem", "AFXWIN/CComboBox::Copy", "AFXWIN/CComboBox::Create", "AFXWIN/CComboBox::Cut", "AFXWIN/CComboBox::DeleteItem", "AFXWIN/CComboBox::DeleteString", "AFXWIN/CComboBox::Dir", "AFXWIN/CComboBox::DrawItem", "AFXWIN/CComboBox::FindString", "AFXWIN/CComboBox::FindStringExact", "AFXWIN/CComboBox::GetComboBoxInfo", "AFXWIN/CComboBox::GetCount", "AFXWIN/CComboBox::GetCueBanner", "AFXWIN/CComboBox::GetCurSel", "AFXWIN/CComboBox::GetDroppedControlRect", "AFXWIN/CComboBox::GetDroppedState", "AFXWIN/CComboBox::GetDroppedWidth", "AFXWIN/CComboBox::GetEditSel", "AFXWIN/CComboBox::GetExtendedUI", "AFXWIN/CComboBox::GetHorizontalExtent", "AFXWIN/CComboBox::GetItemData", "AFXWIN/CComboBox::GetItemDataPtr", "AFXWIN/CComboBox::GetItemHeight", "AFXWIN/CComboBox::GetLBText", "AFXWIN/CComboBox::GetLBTextLen", "AFXWIN/CComboBox::GetLocale", "AFXWIN/CComboBox::GetMinVisible", "AFXWIN/CComboBox::GetTopIndex", "AFXWIN/CComboBox::InitStorage", "AFXWIN/CComboBox::InsertString", "AFXWIN/CComboBox::LimitText", "AFXWIN/CComboBox::MeasureItem", "AFXWIN/CComboBox::Paste", "AFXWIN/CComboBox::ResetContent", "AFXWIN/CComboBox::SelectString", "AFXWIN/CComboBox::SetCueBanner", "AFXWIN/CComboBox::SetCurSel", "AFXWIN/CComboBox::SetDroppedWidth", "AFXWIN/CComboBox::SetEditSel", "AFXWIN/CComboBox::SetExtendedUI", "AFXWIN/CComboBox::SetHorizontalExtent", "AFXWIN/CComboBox::SetItemData", "AFXWIN/CComboBox::SetItemDataPtr", "AFXWIN/CComboBox::SetItemHeight", "AFXWIN/CComboBox::SetLocale", "AFXWIN/CComboBox::SetMinVisibleItems", "AFXWIN/CComboBox::SetTopIndex", "AFXWIN/CComboBox::ShowDropDown"]
helpviewer_keywords: ["CComboBox [MFC], CComboBox", "CComboBox [MFC], AddString", "CComboBox [MFC], Clear", "CComboBox [MFC], CompareItem", "CComboBox [MFC], Copy", "CComboBox [MFC], Create", "CComboBox [MFC], Cut", "CComboBox [MFC], DeleteItem", "CComboBox [MFC], DeleteString", "CComboBox [MFC], Dir", "CComboBox [MFC], DrawItem", "CComboBox [MFC], FindString", "CComboBox [MFC], FindStringExact", "CComboBox [MFC], GetComboBoxInfo", "CComboBox [MFC], GetCount", "CComboBox [MFC], GetCueBanner", "CComboBox [MFC], GetCurSel", "CComboBox [MFC], GetDroppedControlRect", "CComboBox [MFC], GetDroppedState", "CComboBox [MFC], GetDroppedWidth", "CComboBox [MFC], GetEditSel", "CComboBox [MFC], GetExtendedUI", "CComboBox [MFC], GetHorizontalExtent", "CComboBox [MFC], GetItemData", "CComboBox [MFC], GetItemDataPtr", "CComboBox [MFC], GetItemHeight", "CComboBox [MFC], GetLBText", "CComboBox [MFC], GetLBTextLen", "CComboBox [MFC], GetLocale", "CComboBox [MFC], GetMinVisible", "CComboBox [MFC], GetTopIndex", "CComboBox [MFC], InitStorage", "CComboBox [MFC], InsertString", "CComboBox [MFC], LimitText", "CComboBox [MFC], MeasureItem", "CComboBox [MFC], Paste", "CComboBox [MFC], ResetContent", "CComboBox [MFC], SelectString", "CComboBox [MFC], SetCueBanner", "CComboBox [MFC], SetCurSel", "CComboBox [MFC], SetDroppedWidth", "CComboBox [MFC], SetEditSel", "CComboBox [MFC], SetExtendedUI", "CComboBox [MFC], SetHorizontalExtent", "CComboBox [MFC], SetItemData", "CComboBox [MFC], SetItemDataPtr", "CComboBox [MFC], SetItemHeight", "CComboBox [MFC], SetLocale", "CComboBox [MFC], SetMinVisibleItems", "CComboBox [MFC], SetTopIndex", "CComboBox [MFC], ShowDropDown"]
ms.assetid: 4e73b5df-0d2e-4658-9706-38133fb10513
Expand Down Expand Up @@ -810,7 +811,8 @@ The length (in bytes) of the string, excluding the terminating null character. I

### Remarks

The second form of this member function fills a `CString` object with the item's text.
The second form of this member function fills a `CString` object with the item's text.\
If *nIndex* is invalid, this function throws an `E_INVALIDARG` exception (error code: `-2147024809`, `0x80070057`).

### Example

Expand Down
Loading