-Pe: Do Not Preprocess Escape Sequences in Strings with Absolute DOS Paths

Group

LANGUAGE

Scope

Compilation Unit

Syntax
  -Pe
  
  
Arguments

None

Default

None

Defines

None

Pragmas

None

Description

The Compiler handles escape sequences in macros in an include directive, similar to the way the Compiler handles escape sequences in a printf() instruction:

  #define STRING "C:\myfile.h"

  
  #include STRING

  

produces an error:

  >> Illegal escape sequence

  

and:

  printf(STRING);

  

produces a carriage return with line feed:

  C:

  
  myfile

  

Using the -Pe option, the Compiler ignores escape sequences in strings that contain a DOS drive letter (' a' - ' z', ' A' - ' Z') followed by a colon ' :' and a backslash ' \'.

Enable the -Pe option to make the Compiler handle strings in include directives differently from other strings. Escape sequences in include directive strings are not evaluated.

The following example:

  #include "C:\names.h"

  

results in exactly the same include filename as in the source file (" C:\names.h"). If the filename appears in a macro, the Compiler does not distinguish between filename usage and normal string usage with escape sequence. This occurs because the macro STRING has to be the same for the include and the printf() call, as shown below:

  #define STRING "C:\n.h"

  
  #include STRING /* means: "C:\n.h" *

  
  void main(void) {

  
    printf(STRING);/* means: "C:", new line and ".h" */

  
  }

  

Use this option to use macros for include files. This prevents escape sequence scanning in strings that start with a DOS drive letter ('a - 'z', 'A' - 'Z') followed by a colon ' :' and a backslash ' \'. With the option set, the above example includes the ' C:\n.h' file and calls printf() with "C:\n.h").

Example
  -Pe