HPlogo HP C++ Programmer's Guide: HP 9000 Series Workstations and Servers > Chapter 2 The HP C++ Preprocessor

Pragma Directive

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

A #pragma directive is an instruction to the compiler. You typically use a #pragma directive to control the actions of the compiler in a particular portion of a program without affecting the program as a whole.

Syntax

pragma-directive ::=
     #pragma [token-list]

Description

The #pragma directive is ignored by the preprocessor, and instead is passed on to the C++ compiler. It provides implementation-dependent information to HP C++. Refer to Chapter 3 “Compiling and Executing HP C++ Programs”, "Compiling and Executing HP C++ Programs," for descriptions of pragmas recognized by HP C++. Any pragma that is not recognized by HP C++ will generate a warning from the compiler. The following is an example of a #pragma directive.

Example

#pragma OPTIMIZE ON
© Hewlett-Packard Development Company, L.P.