Compiling C++ Programs; Options Controlling C Dialect - Red Hat ENTERPRISE LINUX 3 - USING GCC Using Instructions

Using the gnu compiler collection (gcc)
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING GCC:
Table of Contents

Advertisement

Chapter 4. GCC Command Options
-pipe
Use pipes rather than temporary files for communication between the various stages of compila-
tion. This fails to work on some systems where the assembler is unable to read from a pipe; but
the GNU assembler has no trouble.
-help
Print (on the standard output) a description of the command line options understood by
the
option is also specified then
-v
by
, so that they can display the command line options they accept. If the
gcc
is also specified then command line options which have no documentation associated with them
will also be displayed.
-target-help
Print (on the standard output) a description of target specific command line options for each tool.
-version
Display the version number and copyrights of the invoked GCC.

4.3. Compiling C++ Programs

C++ source files conventionally use one of the suffixes
C++ header files often use
files with these names and compiles them as C++ programs even if you call the compiler the same
way as for compiling C programs (usually with the name
However, C++ programs often require class libraries as well as a compiler that understands the C++
language--and under some circumstances, you might want to compile programs or header files from
standard input, or otherwise without a suffix that flags them as C++ programs. You might also like to
precompile a C header file with a
calls GCC with the default language set to C++, and automatically specifies linking against the C++
library. On many systems,
When you compile C++ programs, you may specify many of the same command-line options that you
use for compiling programs in any language; or command-line options meaningful for C and related
languages; or options that are meaningful only for C++ programs. Section 4.4 Options Controlling C
Dialect, for explanations of options for languages related to C. Section 4.5 Options Controlling C++
Dialect, for explanations of options that are meaningful only for C++ programs.

4.4. Options Controlling C Dialect

The following options control the dialect of C (or languages derived from C, such as C++ and
Objective-C) that the compiler accepts:
-ansi
In C mode, support all ISO C90 programs. In C++ mode, remove GNU extensions that conflict
with ISO C++.
This turns off certain features of GCC that are incompatible with ISO C90 (when compiling C
code), or of standard C++ (when compiling C++ code), such as the
and predefined macros such as
also enables the undesirable and rarely used ISO trigraph feature. For the C compiler, it disables
recognition of C++ style
will also be passed on to the various processes invoked
-help
or
; and preprocessed C++ files use the suffix
.hh
.H
extension to be used in C++ compilations.
.h
is also installed with the name
g++
and
unix
vax
comments as well as the
//
,
,
,
.C
.cc
.cpp
).
gcc
.
c++
that identify the type of system you are using. It
keyword.
inline
-Wextra
,
,
, or
.CPP
.c++
.cp
. GCC recognizes
.ii
is a program that
g++
and
keywords,
asm
typeof
15
. If
gcc
option
;
.cxx

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Enterprise linux 3

Table of Contents