Skip to content

Commit da4e2d7

Browse files
author
Colin Robertson
authored
Update defaults for /ZH flag per STL (MicrosoftDocs#4071)
* Update defaults for /ZH flag per STL * Tweaks and typo fixes
1 parent 42ebbf7 commit da4e2d7

File tree

2 files changed

+85
-81
lines changed

2 files changed

+85
-81
lines changed
Lines changed: 68 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "ML and ML64 command-line reference"
33
description: "Reference guide to the Microsoft MASM ML and ML64 assembler command-line options."
4-
ms.date: "02/09/2020"
4+
ms.date: 02/01/2022
55
f1_keywords: ["ML"]
66
helpviewer_keywords: ["/W* MASM compiler option", "/c MASM compiler option", "/EP MASM compiler option", "/Fe MASM compiler option", "/Zp MASM compiler option", "/AT MASM compiler option", "/Zm MASM compiler option", "/Sf MASM compiler option", "/Sp MASM compiler option", "/w MASM compiler option", "/Fl MASM compiler option", "/coff MASM compiler option", "/St MASM compiler option", "/Cx MASM compiler option", "/Sl MASM compiler option", "/Cu MASM compiler option", "MASM (Microsoft Macro Assembler), ML command-line reference", "/FPi MASM compiler option", "/Zf MASM compiler option", "ML environment variable", "/Fr MASM compiler option", "/help MASM compiler option", "/Sa MASM compiler option", "/Zd MASM compiler option", "/I MASM compiler option", "/? MASM compiler option", "/Bl MASM compiler option", "/Fm MASM compiler option", "/Fo MASM compiler option", "command-line reference [ML]", "/Sn MASM compiler option", "/Gd MASM compiler option", "/D* MASM compiler option", "environment variables, ML", "/Gc MASM compiler option", "/F* MASM compiler option", "/Sc MASM compiler option", "/H MASM compiler option", "/Zs MASM compiler option", "/omf MASM compiler option", "/Sg MASM compiler option", "/Cp MASM compiler option", "/Zi MASM compiler option", "/nologo MASM compiler option", "/Sx MASM compiler option", "/WX MASM compiler option", "/Ss MASM compiler option", "command line, reference [ML]", "/Ta MASM compiler option"]
77
ms.assetid: 712623c6-f77e-47ea-a945-089e57c50b40
@@ -14,88 +14,90 @@ For more information on ml64.exe, see [MASM for x64 (ml64.exe)](masm-for-x64-ml6
1414

1515
## Syntax
1616

17-
> ML \[*options*] *filename* \[ \[*options*] *filename*]
17+
> **`ML`** \[*`options`*] *`filename`* \[ \[*`options`*] *`filename`*]
1818
>
19-
> ML64 \[*options*] *filename* \[ \[*options*] *filename*] ... \[/link *link_options*]
19+
> **`ML64`** \[*`options`*] *`filename`* \[ \[*`options`*] *`filename`*] ... \[**`/link`** *`link_options`*]
2020
2121
### Parameters
2222

23-
*options*\
24-
The options listed in the following table.
25-
26-
|Option|Action|
27-
|------------|------------|
28-
|**/AT**|Enables tiny-memory-model support. Enables error messages for code constructs that violate the requirements for .com format files. This option isn't equivalent to the [.MODEL](dot-model.md) **TINY** directive.<br /><br /> Not available in ml64.exe.|
29-
|**/Bl** *filename*|Selects an alternate linker.|
30-
|**/c**|Assembles only. Does no linking.|
31-
|**/coff**|Generates common object file format (COFF) type of object module. Required for Win32 assembly language development.<br /><br /> Not available in ml64.exe.|
32-
|**/Cp**|Preserves case of all user identifiers.|
33-
|**/Cu**|Maps all identifiers to upper case (default).<br /><br /> Not available in ml64.exe.|
34-
|**/Cx**|Preserves case in public and extern symbols.|
35-
|**/D** *symbol*⟦=*value*|Defines a text macro with the given name. If *value* is missing, it's blank. Multiple tokens separated by spaces must be enclosed in quotation marks.|
36-
|**/EP**|Generates a preprocessed source listing (sent to STDOUT). See **/Sf**.|
37-
|**/ERRORREPORT** [ **NONE** &#124; **PROMPT** &#124; **QUEUE** &#124; **SEND** ]| Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
38-
|**/F** *hexnum*|Sets stack size to *hexnum* bytes (the same as **/link /STACK**:*number*). The value must be expressed in hexadecimal notation. There must be a space between **/F** and *hexnum*.|
39-
|**/Fe** *filename*|Names the executable file.|
40-
|**/Fl***filename*|Generates an assembled code listing. See **/Sf**.|
41-
|**/Fm***filename*|Creates a linker map file.|
42-
|**/Fo** *filename*|Names an object file. For more information, see [Remarks](#remarks).|
43-
|**/FPi**|Generates emulator fix-ups for floating-point arithmetic (mixed language only).<br /><br /> Not available in ml64.exe.|
44-
|**/Fr***filename*|Generates a source browser .sbr file.|
45-
|**/FR***filename*|Generates an extended form of a source browser .sbr file.|
46-
|**/Gc**|Specifies use of FORTRAN- or Pascal-style function calling and naming conventions. Same as **OPTION LANGUAGE:PASCAL**.<br /><br /> Not available in ml64.exe.|
47-
|**/Gd**|Specifies use of C-style function calling and naming conventions. Same as **OPTION LANGUAGE:C**.<br /><br /> Not available in ml64.exe.|
48-
|**/GZ**|Specifies use of __stdcall function calling and naming conventions. Same as **OPTION LANGUAGE:STCALL**.<br /><br /> Not available in ml64.exe.|
49-
|**/H** *number*|Restricts external names to number significant characters. The default is 31 characters.<br /><br /> Not available in ml64.exe.|
50-
|**/help**|Calls QuickHelp for help on ML.|
51-
|**/I** *pathname*|Sets path for include file. A maximum of 10 **/I** options is allowed.|
52-
|**/nologo**|Suppresses messages for successful assembly.|
53-
|**/omf**|Generates object module file format (OMF) type of object module. **/omf** implies **/c**; ML.exe doesn't support linking OMF objects.<br /><br /> Not available in ml64.exe.|
54-
|**/Sa**|Turns on listing of all available information.|
55-
|**/safeseh**|Marks the object as either containing no exception handlers or containing exception handlers that are all declared with [.SAFESEH](dot-safeseh.md).<br /><br /> Not available in ml64.exe.|
56-
|**/Sf**|Adds first-pass listing to listing file.|
57-
|**/Sl** *width*|Sets the line width of source listing in characters per line. Range is 60 to 255 or 0. Default is 0. Same as [PAGE](page.md) width.|
58-
|**/Sn**|Turns off symbol table when producing a listing.|
59-
|**/Sp** *length*|Sets the page length of source listing in lines per page. Range is 10 to 255 or 0. Default is 0. Same as [PAGE](page.md) length.|
60-
|**/Ss** *text*|Specifies text for source listing. Same as [SUBTITLE](subtitle.md) text.|
61-
|**/St** *text*|Specifies title for source listing. Same as [TITLE](title.md) text.|
62-
|**/Sx**|Turns on false conditionals in listing.|
63-
|**/Ta** *filename*|Assembles source file whose name doesn't end with the .asm extension.|
64-
|**/w**|Same as **/W0/WX**.|
65-
|**/W** *level*|Sets the warning level, where *level* = 0, 1, 2, or 3.|
66-
|**/WX**|Returns an error code if warnings are generated.|
67-
|**/X**|Ignore INCLUDE environment path.|
68-
|**/Zd**|Generates line-number information in object file.|
69-
|**/Zf**|Makes all symbols public.|
70-
|**/Zi**|Generates CodeView information in object file.|
71-
|**/Zm**|Enables**M510** option for maximum compatibility with MASM 5.1.<br /><br /> Not available in ml64.exe.|
72-
|**/Zp***alignment*|Packs structures on the specified byte boundary. The *alignment* can be 1, 2, or 4.|
73-
|**/Zs**|Performs a syntax check only.|
74-
|**/?**|Displays a summary of ML command-line syntax.|
75-
76-
*filename*\
23+
*`options`*\
24+
The options listed in the following table:
25+
26+
| Option | Action |
27+
|--|--|
28+
| **`/AT`** | Enables tiny-memory-model support. Enables error messages for code constructs that violate the requirements for *`.com`* format files. This option isn't equivalent to the [`.MODEL`](dot-model.md) **`TINY`** directive.<br /> Not available in ml64.exe. |
29+
| **`/Bl`** *`filename`* | Selects an alternate linker in *`filename`*. |
30+
| **`/c`** | Assembles only. Does no linking. |
31+
| **`/coff`** | Generates common object file format (COFF) type of object module. Required for Win32 assembly language development.<br /> Not available in ml64.exe. |
32+
| **`/Cp`** | Preserves case of all user identifiers. |
33+
| **`/Cu`** | Maps all identifiers to upper case (default).<br /> Not available in ml64.exe. |
34+
| **`/Cx`** | Preserves case in public and extern symbols. |
35+
| **`/D`** *`symbol`*⟦=*`value`*| Defines a text macro with the given name *`symbol`*. If *`value`* is missing, it's blank. Multiple tokens separated by spaces must be enclosed in quotation marks. |
36+
| **`/EP`** | Generates a preprocessed source listing (sent to `STDOUT`). See **`/Sf`**. |
37+
| **`/ERRORREPORT`** [ **`NONE`** &#124; **`PROMPT`** &#124; **`QUEUE`** &#124; **`SEND`** ] | Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
38+
| **`/F`** *`hexnum`* | Sets stack size to *`hexnum`* bytes (the same as **`/link /STACK:<number>`**). The value must be expressed in hexadecimal notation. There must be a space between **`/F`** and *`hexnum`*. |
39+
| **`/Fe`** *`filename`* | Names the executable file. |
40+
| **`/Fl`***`filename`*| Generates an assembled code listing. See **/Sf**. |
41+
| **`/Fm`***`filename`*| Creates a linker map file. |
42+
| **`/Fo`** *`filename`* | Names an object file. For more information, see [Remarks](#remarks). |
43+
| **`/FPi`** | Generates emulator fix-ups for floating-point arithmetic (mixed language only).<br /> Not available in ml64.exe. |
44+
| **`/Fr`***`filename`*| Generates a source browser *`.sbr`* file. |
45+
| **`/FR`***`filename`*| Generates an extended form of a source browser *`.sbr`* file. |
46+
| **`/Gc`** | Specifies use of FORTRAN- or Pascal-style conventions for function calls and names. Same as **`OPTION LANGUAGE:PASCAL`**.<br /> Not available in ml64.exe. |
47+
| **`/Gd`** | Specifies use of C-style conventions for function calls and names. Same as **`OPTION LANGUAGE:C`**.<br /> Not available in ml64.exe. |
48+
| **`/GZ`** | Specifies use of `__stdcall` conventions for function calls and names. Same as **`OPTION LANGUAGE:STDCALL`**.<br /> Not available in ml64.exe. |
49+
| **`/H`** *`number`* | Restricts external names to *`number`* significant characters. The default is 31 characters.<br /> Not available in ml64.exe. |
50+
| **`/help`** | Displays a summary of ML command-line syntax and options. |
51+
| **`/I`** *`pathname`* | Sets path for include file. A maximum of 10 **`/I`** options is allowed. |
52+
| **`/nologo`** | Suppresses messages for successful assembly. |
53+
| **`/omf`** | Generates object module file format (OMF) type of object module. **`/omf`** implies **`/c`**. ML.exe doesn't support linking OMF objects.<br /> Not available in ml64.exe. |
54+
| **`/Sa`** | Turns on listing of all available information. |
55+
| **`/safeseh`** | Marks the object file: either it contains no exception handlers, or it contains exception handlers that are all declared with [`.SAFESEH`](dot-safeseh.md).<br /> Not available in ml64.exe. |
56+
| **`/Sf`** | Adds the first-pass listing to the listing file. |
57+
| **`/Sl`** *`width`* | Sets the line width of source listing in characters per line to *`width`*. Range is 60-255 or 0. Default is 0. Same as [`PAGE`](page.md) *`width`*. |
58+
| **`/Sn`** | Turns off symbol table when a listing is produced. |
59+
| **`/Sp`** *`length`* | Sets the page length of source listing in lines per page to *`length`*. Range is 10-255 or 0. Default is 0. Same as [`PAGE`](page.md) *`length`*. |
60+
| **`/Ss`** *`text`* | Specifies text for source listing. Same as [`SUBTITLE`](subtitle.md) text. |
61+
| **`/St`** *`text`* | Specifies title for source listing. Same as [`TITLE`](title.md) text. |
62+
| **`/Sx`** | Turns on false conditionals in listing. |
63+
| **`/Ta`** *`filename`* | Assembles source file whose name doesn't end with the *`.asm`* extension. |
64+
| **`/w`** | Same as **`/W0 /WX`**. |
65+
| **`/W`** *`level`* | Sets the warning level, where *`level`* = 0, 1, 2, or 3. |
66+
| **`/WX`** | If warnings are generated, returns an error code. |
67+
| **`/X`** | Ignore `INCLUDE` environment path. |
68+
| **`/Zd`** | Generates line-number information in object file. |
69+
| **`/Zf`** | Makes all symbols public. |
70+
| **`/ZH:MD5`** | Use MD5 for checksum in debug info. |
71+
| **`/ZH:SHA_256`** | Use SHA256 for checksum in debug info (default in Visual Studio 2022 version 17.0 and later). |
72+
| **`/Zi`** | Generates CodeView information in object file. |
73+
| **`/Zm`** | Enables **`M510`** option for maximum compatibility with MASM 5.1.<br /> Not available in ml64.exe. |
74+
| **`/Zp`***`alignment`*| Packs structures on the specified byte boundary. The *`alignment`* can be 1, 2, or 4. |
75+
| **`/Zs`** | Performs a syntax check only. |
76+
| **`/?`** | Displays a summary of ML command-line syntax and options. |
77+
78+
*`filename`*\
7779
The name of the file.
7880

79-
*link_options*\
81+
*`link_options`*\
8082
The link options. For more information, see [Linker options](../../build/reference/linker-options.md).
8183

8284
## Remarks
8385

84-
Some command-line options to ML and ML64 are placement-sensitive. For example, because ML and ML64 can accept several **/c** options, any corresponding **/Fo** options must be specified before **/c**. The following command-line example illustrates an object file specification for each assembly file specification:
86+
Some command-line options to ML and ML64 are placement-sensitive. For example, because ML and ML64 can accept several **`/c`** options, any corresponding **`/Fo`** options must be specified before **`/c`**. The following command-line example illustrates an object file specification for each assembly file specification:
8587

8688
```cmd
8789
ml.exe /Fo a1.obj /c a.asm /Fo b1.obj /c b.asm
8890
```
8991

9092
## Environment Variables
9193

92-
|Variable|Description|
93-
|--------------|-----------------|
94-
|INCLUDE|Specifies search path for include files.|
95-
|ML|Specifies default command-line options.|
96-
|TMP|Specifies path for temporary files.|
94+
| Variable | Description |
95+
|--|--|
96+
| `INCLUDE` | Specifies search path for include files. |
97+
| `ML` | Specifies default command-line options. |
98+
| `TMP` | Specifies path for temporary files. |
9799

98100
## See also
99101

100-
[ML Error Messages](ml-error-messages.md)\
101-
[Microsoft Macro Assembler Reference](microsoft-macro-assembler-reference.md)
102+
[ML error messages](ml-error-messages.md)\
103+
[Microsoft Macro Assembler reference](microsoft-macro-assembler-reference.md)

docs/build/reference/zh.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,50 @@
11
---
22
title: "/ZH (Hash algorithm for calculation of file checksum in debug info)"
33
description: "Use the /ZH compiler option to enable MD5, SHA-1, or SHA-256 source file checksums in debug info"
4-
ms.date: "09/16/2019"
4+
ms.date: 02/01/2022
55
f1_keywords: ["/ZH", "/ZH:MD5", "/ZH:SHA1", "/ZH:SHA_256"]
66
helpviewer_keywords: ["/ZH", "/ZH:MD5", "/ZH:SHA1", "/ZH:SHA_256", "/ZH compiler option", "/ZH:MD5 compiler option", "/ZH:SHA1 compiler option", "/ZH:SHA_256 compiler option", "Hash algorithm for file checksum in debug info"]
77
---
8-
# /ZH (Hash algorithm for calculation of file checksum in debug info)
8+
# `/ZH` (Hash algorithm for calculation of file checksum in debug info)
99

1010
Specifies which cryptographic hash algorithm to use to generate a checksum of each source file.
1111

1212
## Syntax
1313

14-
> **/ZH:**{**MD5**|**SHA1**|**SHA_256**}
14+
> **`/ZH:MD5`**\
15+
> **`/ZH:SHA1`**\
16+
> **`/ZH:SHA_256`**
1517
1618
## Arguments
1719

18-
**/ZH:MD5**\
19-
Use an MD5 hash for the checksum. This option is the default.
20+
**`/ZH:MD5`**\
21+
Use an MD5 hash for the checksum. This option is the default in Visual Studio 2019.
2022

21-
**/ZH:SHA1**\
23+
**`/ZH:SHA1`**\
2224
Use an SHA-1 hash for the checksum.
2325

24-
**/ZH:SHA_256**\
25-
Use an SHA-256 hash for the checksum.
26+
**`/ZH:SHA_256`**\
27+
Use an SHA-256 hash for the checksum. This option is the default in Visual Studio 2022 version 17.0 and later.
2628

2729
## Remarks
2830

29-
PDB files store a checksum for each source file compiled into the object code in the associated executable. The checksum allows the debugger to verify that the source code it loads matches the executable. The compiler and debugger support MD5, SHA-1, and SHA-256 hash algorithms. By default, the compiler uses an MD5 hash to generate the checksum. You can specify this option explicitly by using the **/ZH:MD5** option.
31+
PDB files store a checksum for each source file, compiled into the object code in the associated executable. The checksum allows the debugger to verify that the source code it loads matches the executable. The compiler and debugger support MD5, SHA-1, and SHA-256 hash algorithms. By default, in Visual Studio 2019 the compiler uses an MD5 hash to generate the checksum. To specify this hash algorithm explicitly, use the **`/ZH:MD5`** option.
3032

31-
Because of a risk of collision problems in MD5 and SHA-1, Microsoft recommends you use the **/ZH:SHA_256** option. The SHA-256 hash may result in a small increase in compile times.
33+
Because of a risk of collision problems in MD5 and SHA-1, Microsoft recommends you use the **`/ZH:SHA_256`** option. The SHA-256 hash might result in a small increase in compile times. The **`/ZH:SHA_256`** option is the default in Visual Studio 2022 version 17.0 and later.
3234

33-
When more than one **/ZH** option is specified, the last option is used.
35+
When more than one **`/ZH`** option is specified, the last option is used.
3436

35-
The **/ZH** option is available starting in Visual Studio 2019 version 16.4.
37+
The **`/ZH`** option is available in Visual Studio 2019 version 16.4 and later.
3638

3739
### To set this compiler option in the Visual Studio development environment
3840

39-
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
41+
1. Open the **Property Pages** dialog box for the project. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
4042

41-
1. Set the **Configuration** drop-down to **All Configurations**.
43+
1. Set the **Configuration** drop-down to **All Configurations**. Set the **Platform** drop-down to **All Platforms**.
4244

4345
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
4446

45-
1. Modify the **Additional options** property to add a **/ZH:MD5**, **/ZH:SHA1**, or **/ZH:SHA_256** option, and then choose **OK**.
47+
1. Modify the **Additional options** property to add a **`/ZH:MD5`**, **`/ZH:SHA1`**, or **`/ZH:SHA_256`** option, and then choose **OK**.
4648

4749
## See also
4850

0 commit comments

Comments
 (0)