pragma

Discussion in 'C Programming' started by ramu, Jan 16, 2006.

  1. ramu

    ramu Guest

    HI,
    Can anyone tell me about pragma? And can u give an example of how
    to use it?
    ramu, Jan 16, 2006
    #1
    1. Advertising

  2. ramu

    Ian Collins Guest

    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.
    Ian Collins, Jan 16, 2006
    #2
    1. Advertising

  3. ramu

    Ian Collins Guest

    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.
    Ian Collins, Jan 16, 2006
    #3
  4. ramu

    pemo Guest

    pemo, Jan 16, 2006
    #4
  5. In article <>,
    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.


    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?
    Kenny McCormack, Jan 16, 2006
    #5
  6. ramu

    osmium Guest

    osmium, Jan 16, 2006
    #6
  7. ramu

    Chris Dollin Guest

    Kenny McCormack wrote:

    > In article <>,
    > 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.

    >
    > 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
    Chris Dollin, Jan 16, 2006
    #7
  8. "osmium" <> 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) <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.
    Keith Thompson, Jan 16, 2006
    #8
  9. In article <>,
    Keith Thompson <> 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.
    Kenny McCormack, Jan 17, 2006
    #9
  10. (Kenny McCormack) writes:
    > In article <>,
    > Keith Thompson <> 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) <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.
    Keith Thompson, Jan 17, 2006
    #10
  11. Keith Thompson said:

    > (Kenny McCormack) writes:
    >> In article <>,
    >>
    >> 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)
    Richard Heathfield, Jan 17, 2006
    #11
  12. Richard Heathfield <> writes:
    > Keith Thompson said:
    >> (Kenny McCormack) writes:
    >>> In article <>,
    >>>
    >>> 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) <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.
    Keith Thompson, Jan 17, 2006
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    9
    Views:
    13,839
    Rob Dekker
    Jul 21, 2005
  2. ryang
    Replies:
    1
    Views:
    933
    Wes Groleau
    Apr 11, 2005
  3. Titus A Ducksass
    Replies:
    1
    Views:
    6,014
    Sid Ismail
    Aug 1, 2003
  4. Paul J. Le Genial

    [Q] pragma no-cache : what about the images ?

    Paul J. Le Genial, Mar 14, 2005, in forum: HTML
    Replies:
    5
    Views:
    7,456
  5. Denis Lagno

    Re: pragma

    Denis Lagno, Oct 4, 2003, in forum: C++
    Replies:
    0
    Views:
    411
    Denis Lagno
    Oct 4, 2003
Loading...

Share This Page