delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/15/23:03:11

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: <ww01-BHLJZN2260 AT netaddress DOT usa DOT net>
NNTP-Posting-Host: ip39-67.nol.net
Lines: 23
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Tue, 12 Aug 1997 07:25:13 GMT, "Guan Foo Wah" <jgfw AT usa DOT net> 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 <compiler>
#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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019