Compiler Warning C4335
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Warning C4335

Error Message

Mac file format detected: please convert the source file to either DOS or UNIX format

The line termination character of the first line of a source file is Mac style (‘\r’) as opposed to UNIX (‘\n’) or DOS (‘\r\n’).

This warning is always issued as an errror. See warning pragma for information on how to disable this warning. Also, this warning is only issued once per compiland, so if there are multiple #include directives that specify files in Mac format, C4335 will only be issued once.

One way to generate files in Mac format would be by using the Advanced Save Options (File menu) in Visual Studio.


The following sample generates C4335.

// C4335.cpp
// C4335 expected
#include "c4335.h"   // assume both include files are in Mac format
#include "c4335_2.h"
© 2016 Microsoft