[comp.sys.sun] #pragma C compiler directive

grover@sed170.hac.com (Dean Grover) (11/06/89)

While looking in /usr/include/vfork.h under SunOS 4.0.3, I noticed the
following line:
#pragma unknown_control_flow(vfork)

I can guess what that means to the C compiler, but my question is,
where is the #pragma compiler directive documented ?  I haven't been
able to find it anywhere.

Also, besides "unknown_control_flow", what other options exist ?

Thanks in advance,
Dean Grover
Hughes Aircraft Co.
grover@sed170.hac.com or adgrover@hac2arpa.hac.com

net%TUB.BITNET@mitvma.mit.edu (Oliver Laumann) (11/13/89)

In article <2860@brazos.Rice.edu> you write:
> While looking in /usr/include/vfork.h under SunOS 4.0.3, I noticed the
> following line:
> #pragma unknown_control_flow(vfork)
>
> Also, besides "unknown_control_flow", what other options exist ?

With the help of "strings /lib/ccom" I figured out that there is a second
pragma option named "makes_regs_inconsistent".  Like
"unknown_control_flow", it accepts one or more function names as
arguments.

Regards.
Oliver Laumann              net@TUB.BITNET              net@tub.UUCP

tim@ucbvax.berkeley.edu (Tim Wood) (11/16/89)

In article <2860@brazos.Rice.edu> grover@sed170.hac.com (Dean Grover) writes:
>X-Sun-Spots-Digest: Volume 8, Issue 189, message 7 of 22
>
>I can guess what [#pragma] means to the C compiler, but my question is,
>where is the #pragma compiler directive documented ? 

Try _The C Programming Language_, 2nd Ed., by Kernighan and Ritchie, p.
233.  "#pragma" tells the preprocessor to perform "an
implementation-dependent action."  Looks like a roll-your-own-preprocessor
hook....

bob@morningstar.com (Bob Sutterfield) (11/17/89)

In article <2860@brazos.Rice.edu> grover@sed170.hac.com (Dean Grover) writes:
|   While looking in /usr/include/vfork.h under SunOS 4.0.3, I noticed
|   the following line:
|
|	   #pragma unknown_control_flow(vfork)
|
|   I can guess what that means to the C compiler, but my question is,
|   where is the #pragma compiler directive documented ?  I haven't
|   been able to find it anywhere.

It's an ANSIism.  See K&R II, appendix A 12.8, concerning the
preprocessor.

   Also, besides "unknown_control_flow", what other options exist ?

It's implementation-dependent.  Ask your compiler author.  Oddly enough,
#pragma isn't in the SunOS 4.0.3 cc(1), cpp(1), or m4(1V) pages, nor in
the hardcopy _C_Programmer's_Guide_.