By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,079 Members | 843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,079 IT Pros & Developers. It's quick & easy.

pragma

P: n/a
HI,
Can anyone tell me about pragma? And can u give an example of how
to use it?

Jan 16 '06 #1
Share this Question
Share on Google+
11 Replies


P: n/a
ramu wrote:
HI,
Can anyone tell me about pragma? And can u give an example of how
to use it?

Compiler specific, see you documentation. There is no such word as u.

--
Ian Collins.
Jan 16 '06 #2

P: n/a
Ian Collins wrote:
ramu wrote:
HI,
Can anyone tell me about pragma? And can u give an example of how
to use it?

Compiler specific, see you documentation. There is no such word as u.

Sorry, should be "your documentation".

--
Ian Collins.
Jan 16 '06 #3

P: n/a

"ramu" <ra******@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
HI,
Can anyone tell me about pragma? And can u give an example of how
to use it?


http://www.ucalgary.ca/~bgwong/n869.pdf

See 6.10.6
Jan 16 '06 #4

P: n/a
In article <11***************@drone2-svc-skyt.qsi.net.nz>,
Ian Collins <ia******@hotmail.com> wrote:
ramu wrote:
HI,
Can anyone tell me about pragma? And can u give an example of how
to use it?

Compiler specific, see you documentation. There is no such word as u.


Not necessarily. Below I give a 100% ISO-standard C program that uses
'pragma'.

#include <stdio.h>
int main(void) { puts("pragma is an interestingly concept"); }

Now, you may think this is silly, but the fact that is that here in this
ng, we don't have a clue as to what the OP could possibly be talking about,
so my solution is as good as any other take on it.

Could anyone disagree?

Jan 16 '06 #5

P: n/a

"ramu" wrote:
Can anyone tell me about pragma? And can u give an example of how
to use it?


http://en.wikipedia.org/wiki/Pragma
Jan 16 '06 #6

P: n/a
Kenny McCormack wrote:
In article <11***************@drone2-svc-skyt.qsi.net.nz>,
Ian Collins <ia******@hotmail.com> wrote:
ramu wrote:
HI,
Can anyone tell me about pragma? And can u give an example of how
to use it?
Compiler specific, see you documentation. There is no such word as u.


Not necessarily. Below I give a 100% ISO-standard C program that uses
'pragma'.

#include <stdio.h>
int main(void) { puts("pragma is an interestingly concept"); }

Now, you may think this is silly, but the fact that is that here in this
ng, we don't have a clue as to what the OP could possibly be talking
about,


Why?
so my solution is as good as any other take on it.

Could anyone disagree?


Yes.

--
Chris "understanding is a three-edged sword" Dollin
Jan 16 '06 #7

P: n/a
"osmium" <r1********@comcast.net> writes:
"ramu" wrote:
Can anyone tell me about pragma? And can u give an example of how
to use it?


http://en.wikipedia.org/wiki/Pragma


I wouldn't advise using that article as a source of information about
C's "#pragma". The term "pragma" is a fairly general term for a
compiler directive. The article uses C's "#include" directive as an
example; that's certainly a compiler directive, but it's not a pragma
in the sense that C uses the word.

In C90, the language defines the #pragma construct, but all pragmas
are implementation-defined.

In C99, there are several language defined #pragmas:

#pragma STDC FP_CONTRACT ...
#pragma STDC FENV_ACCESS ...
#pragma STDC CX_LIMITED RANGE ...

where the argument is one of ON, OFF, or DEFAULT. Other #pragmas
starting with "STDC" may appear in future standards; #pragmas not
starting with "STDC" are implementation-defined.

C99 also adds an operator, _Pragma ( string-literal ), which is more
flexible in some cases (it can result from macro expansion, for
example).

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jan 16 '06 #8

P: n/a
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.org> wrote:
....
In C90, the language defines the #pragma construct, but all pragmas
are implementation-defined.

In C99, there are several language defined #pragmas:


Wow. I did not know that. I thought/assumed that pragma was as much
"outside the box" as are the usual suspects (networking, graphics, blah,
blah, blah)

I stand corrected.

Jan 17 '06 #9

P: n/a
ga*****@yin.interaccess.com (Kenny McCormack) writes:
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.org> wrote:
...
In C90, the language defines the #pragma construct, but all pragmas
are implementation-defined.

In C99, there are several language defined #pragmas:


Wow. I did not know that. I thought/assumed that pragma was as much
"outside the box" as are the usual suspects (networking, graphics, blah,
blah, blah)

I stand corrected.


For those of you who have killfiled Kenny McCormack, I felt it
necessary to point out that he's posted something sensible.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jan 17 '06 #10

P: n/a
Keith Thompson said:
ga*****@yin.interaccess.com (Kenny McCormack) writes:
In article <ln************@nuthaus.mib.org>,

I stand corrected.


For those of you who have killfiled Kenny McCormack, I felt it
necessary to point out that he's posted something sensible.


One swallow doesn't make a summer. When he starts posting topical, useful
information on a regular basis, that might be a good time for a heads-up to
his killfilers.

You might wish to pass a copy of this article on to your children (or, in
due course, your grandchildren), in case it ever becomes useful.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 17 '06 #11

P: n/a
Richard Heathfield <in*****@invalid.invalid> writes:
Keith Thompson said:
ga*****@yin.interaccess.com (Kenny McCormack) writes:
In article <ln************@nuthaus.mib.org>,

I stand corrected.


For those of you who have killfiled Kenny McCormack, I felt it
necessary to point out that he's posted something sensible.


One swallow doesn't make a summer. When he starts posting topical, useful
information on a regular basis, that might be a good time for a heads-up to
his killfilers.


Sure, I wasn't making any statement about whether or not this might be
the start of a trend.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jan 17 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.