JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: C++ User's Guide     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information

Preface

Part I C++ Compiler

1.  The C++ Compiler

2.  Using the C++ Compiler

3.  Using the C++ Compiler Options

Part II Writing C++ Programs

4.  Language Extensions

5.  Program Organization

6.  Creating and Using Templates

7.  Compiling Templates

8.  Exception Handling

9.  Improving Program Performance

10.  Building Multithreaded Programs

Part III Libraries

11.  Using Libraries

12.  Using the C++ Standard Library

13.  Using the Classic iostream Library

14.  Building Libraries

Part IV Appendixes

A.  C++ Compiler Options

B.  Pragmas

B.1 Pragma Forms

B.1.1 Overloaded Functions as Pragma Arguments

B.2 Pragma Reference

B.2.1 #pragma align

B.2.2 #pragma does_not_read_global_data

B.2.3 #pragma does_not_return

B.2.4 #pragma does_not_write_global_data

B.2.5 #pragma dumpmacros

B.2.6 #pragma end_dumpmacros

B.2.7 #pragma error_messages

B.2.8 #pragma fini

B.2.9 #pragma hdrstop

B.2.10 #pragma ident

B.2.11 #pragma init

B.2.12 #pragma ivdep

B.2.13 #pragma must_have_frame

B.2.14 #pragma no_side_effect

B.2.15 #pragma opt

B.2.16 #pragma pack(n)

B.2.17 #pragma rarely_called

B.2.18 #pragma returns_new_memory

B.2.19 #pragma unknown_control_flow

B.2.20 #pragma weak

B.2.20.1 #pragma weak name

Glossary

Index

B.1 Pragma Forms

The various forms of a C++ compiler pragma are:

#pragma keyword
#pragma keyword ( a [ , a ] ...) [ , keyword ( a [ , a ] ...) ] ,...
#pragma sun keyword

The variable keyword identifies the specific directive; a indicates an argument.

B.1.1 Overloaded Functions as Pragma Arguments

Several pragmas listed in this appendix take function names as arguments. In the event that the function is overloaded, the pragma uses the function declaration immediately preceding the pragma as its argument. Consider the following example:

int bar(int);
int foo(int);
int foo(double);
#pragma does_not_read_global_data(foo, bar)

In this example, foo means foo(double), the declaration of foo immediately preceding the pragma, and bar means bar(int), the only declared bar. Now, consider this following example in which foo is again overloaded:

int foo(int);
int foo(double);
int bar(int);
#pragma does_not_read_global_data(foo, bar)

In this example, bar means bar(int), the only declared bar.However, the pragma will not know which version of foo to use. To correct this problem, you must place the pragma immediately following the definition of foo that you want the pragma to use.

The following pragmas use the selection method described in this section: