Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!hao!husc6!bbn!kgregory From: kgregory@bbn.COM (Keith D. Gregory) Newsgroups: comp.lang.c Subject: Re: Pragmas Message-ID: <5724@ccv.bbn.COM> Date: 31 Dec 87 18:36:20 GMT References: <17196@topaz.rutgers.edu> <1620005@hpcilzb.HP.COM> Reply-To: kgregory@ccv.bbn.com (Keith D. Gregory) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 23 Summary: Well, here's what it is - now why do I use it? In article <1620005@hpcilzb.HP.COM> cr@hpcilzb.HP.COM (Cindy Roberts) writes: > >> What is a pragma, and what is the function of #pragma in C? > >I would also like a clue! A #pragma statement is "a compiler non-specific way of indicating compiler specific actions". . . a portable way of saying that you have non-portable code. On the surface, this seems to be a good idea - if your compiler sees a #pragma that it doesn't recognize, then it abends. If it does recognize a pragma, then it may (or may not) shift into a special processing mode. Of course, as far as I can tell, there are absolutely no controls on the use of #pragma directives. Two compilers could use the same directive to do different things (picture #pragma assembly, to indicate the use of inline A/L), and fail radically when code for one is compiled under the other. So, to all the people "who really know" . . . is there any good reason for #pragma's existance (I don't consider the above mentioned reason to be "good") -kdg