From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: Question about #pragma Date: Tue, 12 Aug 1997 09:03:37 -0700 Organization: Alcyone Systems Lines: 35 Message-ID: <33F08959.6BFCE741@alcyone.com> References: NNTP-Posting-Host: newton.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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