Mail Archives: djgpp/1997/08/12/17:21:17
Guan Foo Wah wrote:
> I have seem many source code with the word #pragma. I do not know what
> this means. My C book (Teach Yourself C in 21 Days) did not give me any
> info about this. The only thing I know is it is a preprocessor command.
>
> Can anyone care to explain to me what is #pragma. Is it ANSI
> compatible ??
#pragma is ANSI, but it is one of those strange standard features that is
included for the sole purposes of allowing implementation-defined
behavior. From ANSI C, 6.8.6:
A preprocessing directive of the form
# pragma pp-tokens_opt new-line
causes the implmentation to behave in an implementation-defined
manner. Any pragma that is not recognized by the implementation is
ignored.
The #pragmas that are used from one compiler to another change
drastically, and there's no way to know whether one #pragma will work in
another compiler (because usually it won't). And, since #pragmas that
aren't recognized are completely ignored, you need to check what the
#pragma did in the last compiler you were using and see if it's important
enough that you'll need to take steps to ensure that you do it with DJGPP.
--
Erik Max Francis, &tSftDotIotE / email / mailto:max AT alcyone DOT com
Alcyone Systems / web / http://www.alcyone.com/max/
San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W
\
"Love is not love which alters / when it alteration finds."
/ William Shakespeare, _Sonnets_, 116
- Raw text -