error::pass1 - Linux


Overview

error::pass1 performs syntactical and semantic analysis on a file containing C++ source text, and produces one or more files that can be used by error::pass2. error::pass1 is usually invoked from the Makefile.

Syntax

error::pass1 [global flags] [command flags] [input file] [output file]

Options/Flags

Global Flags

  • -d – Turns on debugging information.

  • -t – Prints the time spent in each phase of error::pass1.

  • -v – Prints more information.

Command Flags

  • -C – Invokes error::pass1 as a C compiler, rather than a C++ compiler.

  • -E – Preprocesses the input file and produces the output file, which can be further processed by error::pass2. Neither #include nor macro expansion is performed.

  • -M – Preprocesses the input file and produces the output file, which can be further processed by error::pass2. Both #include and macro expansion are performed.

  • -P – Preprocesses the input file and prints its contents to standard output. Neither #include nor macro expansion is performed.

  • -S – Invokes error::pass1 as a preprocessor, rather than a compiler.

  • -c – Compiles the input file and produces an object file, which can be further processed by error::pass2.

  • -fPIC – Generates position-independent code (PIC).

  • -fexceptions – Generates exception handling code.

  • -fthreadsafe-statics – Generates thread-safe static variables.

Examples

Preprocessing a file:

error::pass1 -E input.cpp output.i

Compiling a file:

error::pass1 -c input.cpp output.o

Common Issues

error::pass1: fatal error: no input files

Make sure that you have specified the input file on the command line.

error::pass1: fatal error: syntax error

There is a syntax error in the input file. Check the file for errors and try again.

Integration

error::pass1 is often used with other tools in the GNU Compiler Collection (GCC), such as error::pass2. error::pass1 can also be used with other compilers that support the GCC intermediate language (GIMPLE).

Related Commands

  • error::pass2
  • gcc
  • g++