Skip to content

Commit 9fc74e8

Browse files
TylerMSFTTylerMSFT
authored andcommitted
add required compiler flag
1 parent 6436625 commit 9fc74e8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎docs/c-language/static-assert-c.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ You can use the **`static_assert`** keyword at global or function scope.
3535
In the following example, the **`static_assert`** is at global scope. Because the compiler knows the value of the enum elements, the expression can be evaluated at compile time.
3636

3737
```c
38+
// requires /std:c17
3839
enum
3940
{
4041
A=0,
@@ -51,6 +52,7 @@ static_assert( Last==3, "Expected enum to have three elements");
5152
In the following example, the **`static_assert`** declaration is at function scope and verifies that the size of the integer parameter is 32 bits.
5253

5354
```c
55+
// requires /std:c17
5456
void test(int x)
5557
{
5658
static_assert(sizeof(x)==4, "Expecting 32 bit integers");

0 commit comments

Comments
 (0)