Running Protoize - 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
Alternatively, you might decide to put the precompiled header file in a directory and use
that directory is searched before (or instead of) the directory containing the original header. Then, if
you want to check that the precompiled header file is always used, you can put a file of the same name
as the original header in this directory containing an
This also works with
not designed with precompiled header files in mind, is to simply take most of the header files used
by a project, include them from another header file, precompile that header file, and
precompiled header. If the header files have guards against multiple inclusion, they will be skipped
because they've already been included (in the precompiled header).
If you need to precompile the same header file for different languages, targets, or compiler options,
you can instead make a directory named like
directory. (It doesn't matter what you call the files in the directory, every precompiled header in the
directory will be considered.) The first precompiled header encountered in the directory that is valid
for this compilation will be used; they're searched in no particular order.
There are many other possibilities, limited only by your imagination, good sense, and the constraints
of your build system.
A precompiled header file can be used only when these conditions apply:
Only one precompiled header can be used in a particular compilation.
A precompiled header can't be used once the first C token is seen. You can have preprocessor
directives before a precompiled header; you can even include a precompiled header from inside
another header, so long as there are no C tokens before the
The precompiled header file must be produced for the same language as the current compilation.
You can't use a C precompiled header for a C++ compilation.
The precompiled header file must be produced by the same compiler version and configuration
as the current compilation is using. The easiest way to guarantee this is to use the same compiler
binary for creating and using precompiled headers.
Any macros defined before the precompiled header (including with
the same way as when the precompiled header was generated, or must not affect the precompiled
header, which usually means that the they don't appear in the precompiled header at all.
Certain command-line options must be defined in the same way as when the precompiled header
was generated. At present, it is not clear which options are safe to change and which are not; the
safest choice is to use exactly the same options when generating and using the precompiled header.
For all of these but the last, the compiler will automatically ignore the precompiled header if the
conditions aren't met. For the last item, some option changes will cause the precompiled header to
be rejected, but not all incompatible option combinations have yet been found. If you find a new
incompatible combination, please consider filing a bug report, see Chapter 12 Reporting Bugs.

4.21. Running Protoize

The program
protoize
thus converting the program to ISO C in one respect. The companion program
reverse: it removes argument types from any prototypes that are found.
When you run these programs, you must specify a set of source files as command line arguments.
The conversion programs start out by compiling these files to see what functions they define. The
information gathered about a file
After scanning comes actual conversion. The specified files are all eligible to be converted; any files
they include (whether sources or just headers) are eligible as well.
. So yet another way to use precompiled headers, good for projects
-include
is an optional part of GCC. You can use it to add prototypes to a program,
is saved in a file named
foo
command.
#error
, and put each precompiled header in the
all.h.gch
#include
.X
foo
-I
-include
.
) must either be defined in
-D
unprotoize
.
111
to ensure
the
does the

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