HPlogo HP C/HP-UX Reference Manual: Version A.05.55.02 > Chapter 7 Preprocessing Directives

Pragma Directive (#pragma)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

You can provide instructions to the compiler through inclusion of pragmas.

Syntax

pragma-directive ::=
#pragma replacement-list

Description

The #pragma preprocessing directive provides implementation-dependent information to the compiler. See Chapter 9 “Compiling and Running HP C Programs ” for descriptions of pragmas recognized by HP C/HP-UX. Any pragma that is not recognized by the compiler is ignored.

Example

#pragma OPTIMIZE ON

#pragma OPTIMIZE OFF

This pragma is used to toggle optimization on/off for different sections of source code as these pragmas are encountered in a top to bottom read of a source file.

© Hewlett-Packard Development Company, L.P.