Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.32 KB

compiler-warning-level-1-c4179.md

File metadata and controls

42 lines (32 loc) · 1.32 KB
description title ms.date f1_keywords helpviewer_keywords
Learn more about: Compiler Warning (level 1) C4179
Compiler Warning (level 1) C4179
05/03/2021
C4179
C4179

Compiler Warning (level 1) C4179

'//*' : parsed as '/' and '/*': confusion with standard '//' comments

In standard C89, //* is an incorrect comment delimiter. Use /* under /Za instead.

Remarks

Before Visual Studio 2017 version 15.5, under /Za, the C compiler emits C4179 for a non-standard comment delimiter.

In Visual Studio 2017 version 15.5, the C compiler no longer emits warnings C4001 and C4179. The warnings aren't needed because single-line comments have been part of the C standard since C99.

/* C only */
#pragma warning(disable:4001) // C4619
#pragma warning(disable:4179)
// single line comment
//* also a single line comment */    // Caused C4179
warning C4619: #pragma warning: there is no warning number '4001'

When the code doesn't need to be backwards compatible, avoid the warning by removing the C4001 and C4179 suppression. If the code does need to be backward compatible, then suppress C4619 only.

/* C only */
#pragma warning(disable:4619)
#pragma warning(disable:4001)
#pragma warning(disable:4179)

// single line comment
//* also a single line comment */