Skip to content

Commit 3217311

Browse files
author
Colin Robertson
authored
Merge pull request #812 from MicrosoftDocs/master636864580077905382
Fix git push error for protected CLA branch
2 parents 11841db + 999f13a commit 3217311

7 files changed

+194
-243
lines changed

docs/build/reference/compiler-options-listed-by-category.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.assetid: c4750dcf-dba0-4229-99b6-45cdecc11729
88

99
This article contains a categorical list of compiler options. For an alphabetical list, see [Compiler Options Listed Alphabetically](compiler-options-listed-alphabetically.md).
1010

11-
### Optimization
11+
## Optimization
1212

1313
|Option|Purpose|
1414
|------------|-------------|
@@ -24,7 +24,7 @@ This article contains a categorical list of compiler options. For an alphabetica
2424
|[/Oy](oy-frame-pointer-omission.md)|Omits frame pointer. (x86 only)|
2525
|[/favor](favor-optimize-for-architecture-specifics.md)|Produces code that is optimized for a specified architecture, or for a range of architectures.|
2626

27-
### Code generation
27+
## Code generation
2828

2929
|Option|Purpose|
3030
|------------|-------------|
@@ -65,7 +65,7 @@ This article contains a categorical list of compiler options. For an alphabetica
6565
|[/RTC](rtc-run-time-error-checks.md)|Enables run-time error checking.|
6666
|[/volatile](volatile-volatile-keyword-interpretation.md)|Selects how the volatile keyword is interpreted.|
6767

68-
### Output files
68+
## Output files
6969

7070
|Option|Purpose|
7171
|------------|-------------|
@@ -80,7 +80,7 @@ This article contains a categorical list of compiler options. For an alphabetica
8080
|[/Fp](fp-name-dot-pch-file.md)|Specifies a precompiled header file name.|
8181
|[/FR, /Fr](fr-fr-create-dot-sbr-file.md)|Name generated .sbr browser files.|
8282

83-
### Preprocessor
83+
## Preprocessor
8484

8585
|Option|Purpose|
8686
|------------|-------------|
@@ -98,7 +98,7 @@ This article contains a categorical list of compiler options. For an alphabetica
9898
|[/u](u-u-undefine-symbols.md)|Removes all predefined macros.|
9999
|[/X](x-ignore-standard-include-paths.md)|Ignores the standard include directory.|
100100

101-
### Language
101+
## Language
102102

103103
|Option|Purpose|
104104
|------------|-------------|
@@ -122,7 +122,7 @@ This article contains a categorical list of compiler options. For an alphabetica
122122
|[/Zs](zs-syntax-check-only.md)|Checks syntax only.|
123123
|[/ZW](zw-windows-runtime-compilation.md)|Produces an output file to run on the Windows Runtime.|
124124

125-
### Linking
125+
## Linking
126126

127127
|Option|Purpose|
128128
|------------|-------------|
@@ -136,7 +136,7 @@ This article contains a categorical list of compiler options. For an alphabetica
136136
|[/MT](md-mt-ld-use-run-time-library.md)|Compiles to create a multithreaded executable file, by using LIBCMT.lib.|
137137
|[/MTd](md-mt-ld-use-run-time-library.md)|Compiles to create a debug multithreaded executable file, by using LIBCMTD.lib.|
138138

139-
### Miscellaneous
139+
## Miscellaneous
140140

141141
|Option|Purpose|
142142
|------------|-------------|
@@ -188,7 +188,7 @@ This article contains a categorical list of compiler options. For an alphabetica
188188
|[/permissive-](permissive-standards-conformance.md)|Set standard-conformance mode.|
189189
|[/std](std-specify-language-standard-version.md)|C++ standard version compatibility selector.|
190190

191-
### Deprecated and removed compiler options
191+
## Deprecated and removed compiler options
192192

193193
|Option|Purpose|
194194
|------------|-------------|
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
---
22
title: "/Za, /Ze (Disable Language Extensions)"
3-
ms.date: "11/04/2016"
3+
ms.date: "02/19/2019"
44
f1_keywords: ["VC.Project.VCCLWCECompilerTool.DisableLanguageExtensions", "/za", "/ze", "VC.Project.VCCLCompilerTool.DisableLanguageExtensions"]
55
helpviewer_keywords: ["-Za compiler option [C++]", "Za compiler option [C++]", "language extensions, disabling in compiler", "-Ze compiler option [C++]", "language extensions", "enable language extensions", "/Za compiler option [C++]", "/Ze compiler option [C++]", "Disable Language Extensions compiler option", "Ze compiler option [C++]"]
66
ms.assetid: 65e49258-7161-4289-a176-7c5c0656b1a2
77
---
88
# /Za, /Ze (Disable Language Extensions)
99

10-
The **/Za** compiler option emits an error for language constructs that are not compatible with ANSI C89 or ISO C++11. The **/Ze** compiler option, which is on by default, enables Microsoft extensions.
10+
The **/Za** compiler option disables and emits errors for Microsoft extensions to C that aren't compatible with ANSI C89/ISO C90. The deprecated **/Ze** compiler option enables Microsoft extensions. Microsoft extensions are enabled by default.
1111

1212
## Syntax
1313

14-
```
15-
/Za
16-
/Ze
17-
```
14+
> **/Za**<br/>
15+
> **/Ze**
1816
1917
## Remarks
2018

2119
> [!NOTE]
22-
> The **/Ze** option is deprecated because its behavior is on by default. We recommend you use the [/Zc (Conformance)](../../build/reference/zc-conformance.md) compiler options to control specific language extension features. For a list of deprecated compiler options, see the **Deprecated and Removed Compiler Options** section in [Compiler Options Listed by Category](../../build/reference/compiler-options-listed-by-category.md).
20+
> The use of **/Za** when code is compiled as C++ is not recommended. The **/Ze** option is deprecated because its behavior is on by default. For a list of deprecated compiler options, see [Deprecated and removed compiler options](compiler-options-listed-by-category.md#deprecated-and-removed-compiler-options).
2321
24-
The Visual C++ compiler offers a number of features beyond those specified in either the ANSI C89, ISO C99, or ISO C++ standards. These features are known collectively as Microsoft extensions to C and C++. These extensions are available by default, and not available when the **/Za** option is specified. For more information about specific extensions, see [Microsoft Extensions to C and C++](../../build/reference/microsoft-extensions-to-c-and-cpp.md).
22+
The Microsoft C/C++ compiler supports compilation of C code in two ways:
2523

26-
We recommend that you disable language extensions by specifying the **/Za** option if you plan to port your program to other environments. When **/Za** is specified, the compiler treats Microsoft extended keywords as simple identifiers, disables the other Microsoft extensions, and automatically defines the `__STDC__` predefined macro for C programs.
24+
- The compiler uses C compilation mode by default when a source file has a *.c* extension, or when the [/Tc](tc-tp-tc-tp-specify-source-file-type.md) or [/TC](tc-tp-tc-tp-specify-source-file-type.md) option is specified. The C compiler is an C89/C90 compiler that, by default, enables Microsoft extensions to the C language. For more information about specific extensions, see [Microsoft Extensions to C and C++](microsoft-extensions-to-c-and-cpp.md). When both C compilation and the **/Za** option are specified, the C compiler conforms strictly to the C89/C90 standard. The compiler treats Microsoft extended keywords as simple identifiers, disables the other Microsoft extensions, and automatically defines the [\_\_STDC\_\_](../../preprocessor/predefined-macros.md) predefined macro for C programs.
2725

28-
Other compiler options used with **/Za** can affect how the compiler ensures standards conformance.
26+
- The compiler can compile C code in C++ compilation mode. This behavior is the default for source files that don't have a *.c* extension, and when the [/Tp](tc-tp-tc-tp-specify-source-file-type.md) or [/TP](tc-tp-tc-tp-specify-source-file-type.md) option is specified. In C++ compilation mode, the compiler supports those parts of the ISO C99 and C11 standards that have been incorporated into the C++ standard. Almost all C code is also valid C++ code. A small number of C keywords and code constructs aren't valid C++ code, or are interpreted differently in C++. The compiler behaves according to the C++ standard in these cases. In C++ compilation mode, the **/Za** option may cause unexpected behavior and isn't recommended.
2927

30-
For ways to specify specific standards-conformant behavior settings, see the [/Zc](../../build/reference/zc-conformance.md) compiler option.
28+
Other compiler options can affect how the compiler ensures standards conformance. For ways to specify specific standard C and C++ behavior settings, see the [/Zc](zc-conformance.md) compiler option. For additional C++ standard conformance settings, see the [/permissive-](permissive-standards-conformance.md) and [/std](std-specify-language-standard-version.md) compiler options.
3129

3230
For more information about conformance issues with Visual C++, see [Nonstandard Behavior](../../cpp/nonstandard-behavior.md).
3331

3432
### To set this compiler option in the Visual Studio development environment
3533

3634
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
3735

38-
1. In the navigation pane, choose **Configuration Properties**, **C/C++**, **Language**.
36+
1. In the navigation pane, choose **Configuration Properties** > **C/C++** > **Language**.
3937

4038
1. Modify the **Disable Language Extensions** property.
4139

4240
### To set this compiler option programmatically
4341

44-
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.DisableLanguageExtensions%2A>.
42+
See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.DisableLanguageExtensions%2A>.
4543

4644
## See Also
4745

48-
[Compiler Options](../../build/reference/compiler-options.md)<br/>
49-
[Setting Compiler Options](../../build/reference/setting-compiler-options.md)<br/>
50-
[/Zc (Conformance)](../../build/reference/zc-conformance.md)
46+
[Compiler Options](compiler-options.md)<br/>
47+
[Setting Compiler Options](setting-compiler-options.md)<br/>
48+
[/Zc (Conformance)](zc-conformance.md)<br/>
49+
[/permissive- (Standards conformance)](permissive-standards-conformance.md)<br/>
50+
[/std (Specify Language Standard Version)](std-specify-language-standard-version.md)<br/>

docs/windows/how-to-copy-resources.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,71 @@ ms.assetid: 65f523e8-017f-4fc6-82d1-083c56d9131f
77
---
88
# How to: Manage Resources (C++)
99

10-
## Copy Resources
10+
You can manage resources for your project by:
1111

12-
You can copy resources from one file to another without changing them or you can change the language or condition of a resource while copying it.
12+
- Copying and editing resources.
13+
14+
- Importing and exporting resources.
15+
16+
## Copy and Edit Resources
17+
18+
You can copy resources from one file to another without changing them, or changing the language or condition of a resource while copying it.
1319

1420
You can easily copy resources from an existing resource or executable file to your current resource file. To copy resources, you open both files containing resources at the same time and drag items from one file to another or copy and paste between the two files. This method works for resource script (.rc) files and resource template (.rct) files, and as executable (.exe) files.
1521

1622
> [!NOTE]
1723
> Visual C++ includes sample resource files that you can use in your own application. For more information, see [CLIPART: Common Resources](https://github.com/Microsoft/VCSamples).
1824
19-
You can use the drag-and-drop method between .rc files that are open [outside of the project](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md).
25+
You can use the drag-and-drop method between .rc files that are open outside of the project.
2026

21-
### To copy resources between files using the drag-and-drop method
27+
### To copy resources
2228

23-
1. Open both resource files stand-alone (for more information, see [view resources in an .rc file outside of a project](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)). For example, open *Source1.rc* and *Source2.rc*.
29+
1. Open both resource files stand-alone (see how to [to open a resource script file](/how-to-create-a-resource-script-file#use-resource-script-files)). For example, open *Source1.rc* and *Source2.rc*.
2430

25-
1. Inside the first .rc file, select the resource you wish to copy. For example, in *Source1.rc*, select **IDD_DIALOG1**.
31+
1. Inside the first .rc file, either:
2632

27-
1. Hold down the **Ctrl** key and drag the resource to the second .rc file. For example, drag **IDD_DIALOG1** from *Source1.rc* to *Source2.rc*.
33+
- Use the drag-and-drop method
2834

29-
> [!NOTE]
30-
> Dragging the resource without holding down the **Ctrl** key moves the resource rather than copying it.
35+
1. Select the resource you wish to copy. For example, in *Source1.rc*, select **IDD_DIALOG1**.
3136

32-
### To copy resources using copy and paste
37+
1. Hold down the **Ctrl** key and drag the resource to the second .rc file. For example, drag **IDD_DIALOG1** from *Source1.rc* to *Source2.rc*.
3338

34-
1. Open both resource files stand-alone (for more information, see [view resources in an .rc file outside of a project](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)). For example, *Source1.rc* and *Source2.rc*.
39+
> [!TIP]
40+
> Dragging the resource without holding down the **Ctrl** key moves the resource rather than copying it.
3541
36-
1. In the source file from which you wish to copy a resource (for example, *Source1.rc*), right-click a resource and choose **Copy** from the shortcut menu.
42+
- Use the copy and paste method
3743

38-
1. Right-click the resource file into which you'd like to paste the resource (for example, *Source2.rc*). Choose **Paste** from the shortcut menu.
44+
1. Right-click the resource you with to copy (for example, *Source1.rc*) and choose **Copy**.
3945

40-
> [!NOTE]
41-
> You cannot drag and drop, copy, cut, or paste between resource files in the project (**Resource View**) and stand-alone .rc files (those open in document windows). You could do this in previous versions of the product.
46+
1. Right-click the resource file into which you'd like to paste the resource (for example, *Source2.rc*) and choose **Paste**.
4247

43-
> [!NOTE]
44-
> To avoid conflicts with symbol names or values in the existing file, Visual C++ may change the transferred resource's symbol value or symbol name and value when you copy it to the new file.
48+
> [!NOTE]
49+
> You can't drag and drop, copy, cut, or paste between resource files in the project (**Resource View**) and stand-alone .rc files (those open in document windows). You could do this in previous versions of the product.
4550
46-
### Change the language or condition of a resource while copying
51+
> [!NOTE]
52+
> To avoid conflicts with symbol names or values in the existing file, Visual C++ may change the transferred resource's symbol value or symbol name and value when you copy it to the new file.
4753
4854
While copying in a resource, you can change its language property or condition property, or both.
4955

50-
- The language of the resource identifies just that, the language for the resource. The language is used by [FindResource](/windows/desktop/api/winbase/nf-winbase-findresourcea) to help identify the resource for which you're looking. (However, resources can have differences for each language that aren't related to text, for example, accelerators that might only work on a Japanese keyboard or a bitmap that would only be appropriate for Chinese localized builds.)
56+
- The language of a resource specifies the language used by [FindResource](/windows/desktop/api/winbase/nf-winbase-findresourcea) to help identify the resource for which you're looking. Resources can have differences for each language that aren't related to text, for example, accelerators that might only work on a Japanese keyboard or a bitmap that would only be appropriate for Chinese localized builds.
5157

5258
- The condition of a resource is a defined symbol that identifies a condition under which this particular copy of the resource is to be used.
5359

54-
The language and condition of a resource are shown in parentheses after the name of the resource in the **Workspace** window. In this example, the resource named `IDD_AboutBox` is using `Finnish` as its language and its condition is `XX33`.
60+
The language and condition of a resource are shown in parentheses after the name of the resource in the **Workspace** window. Here the resource named `IDD_AboutBox` is using `Finnish` as its language and its condition is `XX33`:
5561

5662
```cpp
5763
IDD_AboutBox (Finnish - XX33)
5864
```
5965
60-
#### To copy an existing resource and change its language or condition
66+
To copy an existing resource and change its language or condition
6167
62-
1. In the .rc file or in the [Resource View](../windows/resource-view-window.md) window, right-click the resource you want to copy.
63-
64-
1. Choose **Insert Copy** from the shortcut menu and set the following:
68+
1. In the .rc file or in the [Resource View](../windows/resource-view-window.md) window, right-click the resource you want to copy and choose **Insert Copy**. Then set the following:
6569
6670
- For the **Language** list box, select the language.
6771
6872
- In the **Condition** box, type the condition.
6973
70-
## Edit Resources
74+
### To edit resources
7175
7276
Managed resource files (.resx) are XML files. When you add a managed resource file to your project from the **Add New Item** dialog box, the **Managed Resources Editor** opens by default.
7377
@@ -76,28 +80,24 @@ Managed resource files (.resx) are XML files. When you add a managed resource fi
7680
You can import graphical resources (bitmaps, icons, cursors, and toolbars), HTML files, and custom resources for use in Visual C++. You can export the same types of files from a Visual C++ project to separate files that can be used outside the development environment.
7781
7882
> [!NOTE]
79-
> Resource types such as accelerators, dialog boxes, and string tables cannot be imported or exported because they are not stand-alone file types.
80-
81-
### To import an individual resource into your current resource file
83+
> Resource types such as accelerators, dialog boxes, and string tables can't be imported or exported because they're not stand-alone file types.
8284
83-
1. In [Resource View](../windows/resource-view-window.md), right-click the node for the resource script (*.rc) file to which you want to add a resource.
85+
### To import a resource into the resource script file
8486
85-
1. Select **Import** on the shortcut menu.
87+
1. In [Resource View](../windows/resource-view-window.md) right-click the node of the resource script (.rc) file to which you want to add a resource and select **Import**.
8688
87-
1. Locate and select the file name of the bitmap (.bmp), icon (.ico), cursor (.cur), Html file (.htm), or other file that you want to import.
89+
1. Locate and choose the file name of the bitmap (.bmp), icon (.ico), cursor (.cur), html file (.htm), or other file to import.
8890
89-
1. Choose **OK** to add the resource to the selected file in **Resource** view.
91+
1. Select **OK** to add the resource to the resource script file.
9092
91-
> [!NOTE]
92-
> The import process works the same way no matter which particular resource type you have selected. The imported resource is automatically added to the correct node for that resource type.
93-
94-
### To export a bitmap, icon, or cursor as a separate file (for use outside of Visual C++)
93+
> [!NOTE]
94+
> The import process works the same no matter which resource type you have selected. The imported resource is automatically added to the correct node of that resource type.
9595
96-
1. In **Resource** view, right-click the resource you want to export.
96+
### To export a resource for use outside of Visual C++
9797
98-
1. Select **Export** on the shortcut menu and accept the current file name or type a new one.
98+
1. In [Resource View](../windows/resource-view-window.md), right-click the resource you want to export and select **Export**. You can accept the current file name or type a new one.
9999
100-
1. Navigate to the folder where you want to save the file and choose **Export**.
100+
1. Navigate to the folder where you want to save the file and select **Export**.
101101
102102
## Requirements
103103
@@ -106,5 +106,5 @@ Win32
106106
## See Also
107107
108108
[Resource Files](../windows/resource-files-visual-studio.md)<br/>
109-
[Create Resources](../windows/how-to-create-a-resource-script-file.md)<br/>
110-
[Include Resources at Compile Time](../windows/how-to-include-resources-at-compile-time.md)<br/>
109+
[How to: Create Resources](../windows/how-to-create-a-resource-script-file.md)<br/>
110+
[How to: Include Resources at Compile Time](../windows/how-to-include-resources-at-compile-time.md)<br/>

0 commit comments

Comments
 (0)