HPlogo HP C/HP-UX Release Notes for HP-UX 11i: HP 9000 Computers > Chapter 1 New and Changed Features

-I- option

» 

Technical documentation

Complete book in PDF

 » Table of Contents

The -I- option indicates an optional list of -Idirectory specifications in which a directory name cannot begin with a hyphen (-) character. The -I- option allows you to override the default -Idirectory search-path, called "view-pathing".

Syntax

-Idirs] -I- [-Idirs]

[-Idirs] indicates an optional list of -Idirectory specifications in which a directory name cannot begin with a hyphen (-) character.

The -I- option allows you to override the default -Idirectory search-path. This feature is called view-pathing. If -I- is not specified, view-pathing is turned off. This is the default.

Specifying -I- serves a dual purpose, as follows:

  • It changes the compiler's search-path for quote enclosed (" ") file names in a #include directive in the following manner:

    • The directory named in the -I option.

    • The standard include directories /opt/aCC/include and /usr/include. The preprocessor does not search the directory of the including file.

  • It separates the search-path list for quoted and angle-bracketed include files.

    Angle-bracket enclosed file names in a #include directive are searched for only in the -I directories specified after -I- on the command-line. Quoted includes are searched for in the directories that both precede and succeed the -I- option.

The standard cc include directories (/usr/include and /opt/ansic/include) are always searched last for both types of include files.

View-pathing can be particularly valuable for medium- to large-sized projects. For example, a project is comprised of two sets of directories. One set contains development versions of some of the headers that the programmer currently modifies. A mirror set contains the official sources.

Without view-pathing, there is no way to completely replace the default -Idirectory search-path with one customized specifically for project development.

© 2000 - Hewlett-Packard Development Company, L.P.