From: lonniem AT cs DOT utexas DOT edu (Lonnie McCullough) Newsgroups: comp.os.msdos.djgpp Subject: Re: Question about #pragma Date: Tue, 12 Aug 1997 20:41:30 GMT Message-ID: <33f0c855.1045227@news.nol.net> References: NNTP-Posting-Host: ip39-67.nol.net Lines: 23 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Tue, 12 Aug 1997 07:25:13 GMT, "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 ?? The #pragma directive is like a signal to the compiler to do something special (like turn off some types of warnings (Borland's #pragma argsused) or to do compiler dependent operations such as #pragma pack). Alot of times #pragma's are compiler dependent (that's actually what they are for so a compiler can implement compiler specific options without interferring with other compilers) so if you want truly portable code always include #pragma's in #ifdef #endif blocks. If a compiler doesn't recognize a #pragma it is supposed to ignore it but MSVC++ 4.1 doesn't tend to do this so I put them in the blocks just to be sure. Lonnie McCullough lonniem AT cs DOT utexas DOT edu